From patchwork Mon Aug 6 11:56:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 10539 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 6676524027 for ; Mon, 6 Aug 2012 11:58:49 +0000 (UTC) Received: from mail-gg0-f180.google.com (mail-gg0-f180.google.com [209.85.161.180]) by fiordland.canonical.com (Postfix) with ESMTP id 368A5A18D40 for ; Mon, 6 Aug 2012 11:58:49 +0000 (UTC) Received: by mail-gg0-f180.google.com with SMTP id f1so2364996ggn.11 for ; Mon, 06 Aug 2012 04:58:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=36WSJ3pGOJw1T7XOvHbYo6Stt9mrDCUros1iGd/Qg6U=; b=QLomEYT3ODjvzuOXmKCUPbb5qN6onMiykyLg3BQYYX5/nWIBJfCf40qQvoJY0ehqVA DVPnxPy6aRC4SCkFpTn+qsp76q9J7uQelhfF8eMl0flF2/2+J3s21/AzDTBnw2/Z+/ly 6N6KjrcKF/MKh4zS5CPgHHb22vKD5BMaaIcFr4RcIGVSY/kusofS2yRgrSbAw/I8eNYa iB/1hWUNRJSB3cvsiQGV0RoIrRKnB8/BpM7GtMYJXp/PeMDWD7tGA1A8Q6ZubICUz4pw 2xm/NqLTWRu7CFDkmhFf812A3HzaucviVoIVb1tKbLSmPEJ8vUgAQgaslWX3+kKXvha+ auow== Received: by 10.50.46.132 with SMTP id v4mr5020219igm.25.1344254328751; Mon, 06 Aug 2012 04:58:48 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.87.40 with SMTP id u8csp436704igz; Mon, 6 Aug 2012 04:58:48 -0700 (PDT) Received: by 10.236.186.73 with SMTP id v49mr9443898yhm.48.1344254328113; Mon, 06 Aug 2012 04:58:48 -0700 (PDT) Received: from mail-yx0-f178.google.com (mail-yx0-f178.google.com [209.85.213.178]) by mx.google.com with ESMTPS id f13si2486257anb.176.2012.08.06.04.58.47 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Aug 2012 04:58:48 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.213.178 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.213.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.213.178 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by mail-yx0-f178.google.com with SMTP id m2so327141yen.37 for ; Mon, 06 Aug 2012 04:58:47 -0700 (PDT) Received: by 10.66.89.234 with SMTP id br10mr17713233pab.25.1344254327427; Mon, 06 Aug 2012 04:58:47 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id sk5sm8844705pbc.7.2012.08.06.04.58.44 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Aug 2012 04:58:46 -0700 (PDT) From: Sachin Kamat To: alsa-devel@alsa-project.org Cc: broonie@opensource.wolfsonmicro.com, tiwai@suse.de, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH 27/27] ASoC: max98095: Use module_i2c_driver Date: Mon, 6 Aug 2012 17:26:00 +0530 Message-Id: <1344254160-6615-28-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1344254160-6615-1-git-send-email-sachin.kamat@linaro.org> References: <1344254160-6615-1-git-send-email-sachin.kamat@linaro.org> X-Gm-Message-State: ALoCoQn1ekiB6k7D9E7b89t/EwwvHuGNtS7U/YlQNYI7HYNfswk+dOx8au/t+2EBVAVxbSDe+FMI module_i2c_driver makes the code simpler by eliminating module_init and module_exit calls. Signed-off-by: Sachin Kamat --- sound/soc/codecs/max98095.c | 18 +----------------- 1 files changed, 1 insertions(+), 17 deletions(-) diff --git a/sound/soc/codecs/max98095.c b/sound/soc/codecs/max98095.c index 7cd508e..38d43c5 100644 --- a/sound/soc/codecs/max98095.c +++ b/sound/soc/codecs/max98095.c @@ -2533,23 +2533,7 @@ static struct i2c_driver max98095_i2c_driver = { .id_table = max98095_i2c_id, }; -static int __init max98095_init(void) -{ - int ret; - - ret = i2c_add_driver(&max98095_i2c_driver); - if (ret) - pr_err("Failed to register max98095 I2C driver: %d\n", ret); - - return ret; -} -module_init(max98095_init); - -static void __exit max98095_exit(void) -{ - i2c_del_driver(&max98095_i2c_driver); -} -module_exit(max98095_exit); +module_i2c_driver(max98095_i2c_driver); MODULE_DESCRIPTION("ALSA SoC MAX98095 driver"); MODULE_AUTHOR("Peter Hsiang");