From patchwork Mon Aug 6 11:55:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 10536 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 3DD8124027 for ; Mon, 6 Aug 2012 11:58:41 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id 07400A18288 for ; Mon, 6 Aug 2012 11:58:40 +0000 (UTC) Received: by mail-yw0-f52.google.com with SMTP id p61so485685yhp.11 for ; Mon, 06 Aug 2012 04:58:40 -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=yRxiuRfHto8ZKwO0UFefcvic5lXR5Hsvn1XjsDiLo4o=; b=hbZmerPzSrsE66DysVqf9UJP0N3p5XPqA8O6ADrPz8moImZi15+zA9JIxXvoJegIxC JLRxpSpiuVG9kqRdWlhfT6Is3YBSm7schDMPdBjApeySJrY5TtpEbFDFf6SRL9N0mkOD gKIUF0SUESM1ngpBdR2TMYF+IrhKtk3kH+xB5LSITGOvzoOJtA5scbvd37jmpQ+s33Lj 6xD6Tt4//5yYKa/j9LSdbJMfX744v7MPFE8VtcgbcCaZlCMJXDUnIH/06nhP71gYNcLZ BP9aaBl2NvRmLcl+4eC8dIh+Z5rMC3LnKOd9y4jlaPDP/XN87hqSkDocZyMkvJiRczf8 tJtg== Received: by 10.50.149.134 with SMTP id ua6mr5056369igb.11.1344254320326; Mon, 06 Aug 2012 04:58:40 -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 u8csp436678igz; Mon, 6 Aug 2012 04:58:39 -0700 (PDT) Received: by 10.236.76.132 with SMTP id b4mr9394301yhe.106.1344254319194; Mon, 06 Aug 2012 04:58:39 -0700 (PDT) Received: from mail-gg0-f178.google.com (mail-gg0-f178.google.com [209.85.161.178]) by mx.google.com with ESMTPS id w42si18394290yhd.18.2012.08.06.04.58.39 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Aug 2012 04:58:39 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.161.178 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.161.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.161.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-gg0-f178.google.com with SMTP id h3so774142gge.37 for ; Mon, 06 Aug 2012 04:58:39 -0700 (PDT) Received: by 10.68.217.202 with SMTP id pa10mr18656138pbc.15.1344254318621; Mon, 06 Aug 2012 04:58:38 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id sk5sm8844705pbc.7.2012.08.06.04.58.35 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Aug 2012 04:58:38 -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 24/27] ASoC: wm8903: Use module_i2c_driver Date: Mon, 6 Aug 2012 17:25:57 +0530 Message-Id: <1344254160-6615-25-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: ALoCoQldsaoGGb3VWJCb/paqd0KwJu6soP6q2TCDSz1YI2SyHP3FO+/ynmoGGumLQ8Ub3nbyQ49q module_i2c_driver makes the code simpler by eliminating module_init and module_exit calls. Signed-off-by: Sachin Kamat --- sound/soc/codecs/wm8903.c | 18 +----------------- 1 files changed, 1 insertions(+), 17 deletions(-) diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c index 73f1c8d..839414f 100644 --- a/sound/soc/codecs/wm8903.c +++ b/sound/soc/codecs/wm8903.c @@ -2241,23 +2241,7 @@ static struct i2c_driver wm8903_i2c_driver = { .id_table = wm8903_i2c_id, }; -static int __init wm8903_modinit(void) -{ - int ret = 0; - ret = i2c_add_driver(&wm8903_i2c_driver); - if (ret != 0) { - printk(KERN_ERR "Failed to register wm8903 I2C driver: %d\n", - ret); - } - return ret; -} -module_init(wm8903_modinit); - -static void __exit wm8903_exit(void) -{ - i2c_del_driver(&wm8903_i2c_driver); -} -module_exit(wm8903_exit); +module_i2c_driver(wm8903_i2c_driver); MODULE_DESCRIPTION("ASoC WM8903 driver"); MODULE_AUTHOR("Mark Brown ");