From patchwork Mon Aug 6 11:55:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 10529 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 83F4324027 for ; Mon, 6 Aug 2012 11:58:19 +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 53EA3A18D3F for ; Mon, 6 Aug 2012 11:58:19 +0000 (UTC) Received: by mail-gg0-f180.google.com with SMTP id f1so2364996ggn.11 for ; Mon, 06 Aug 2012 04:58:19 -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=uwyTGR/UYpb5OO+gE6Y00qqvCAVOukQc/j97ZMj+lLk=; b=eA6ZUvzT+eofkWGLYxGuIqywRgMDkdX8MkRtIa3mmwzfQMgL+xT5zf5Nw7Esga0bpV tnnBNjzUEDS8961OWd/HZ/tzZgBFwlGR7OK0tQO8j7O5tSOfOa/yCYNjAfZRfeE4zI+7 yzG27heJ9+B30W1TU68onJLMgcXinqmIe6fdLS0yNoNliNEQb/kws/jX9bAduE3ZDv3s GnfvQcWl5lsor4CeOw9FHfXnh6mYKKk/yET/TzHHsySLOaUH2SE0WnsHlXVtXvtijqw4 5zsTMXEr+rpLApdosrv+MWtPkoNO0CgTfq6R1Cq65594+3zOyG3TxU8yN4XLvW/8vtxc XSmQ== Received: by 10.50.163.5 with SMTP id ye5mr5079003igb.51.1344254298722; Mon, 06 Aug 2012 04:58:18 -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 u8csp436654igz; Mon, 6 Aug 2012 04:58:18 -0700 (PDT) Received: by 10.236.73.36 with SMTP id u24mr2551600yhd.103.1344254298039; Mon, 06 Aug 2012 04:58:18 -0700 (PDT) Received: from mail-gh0-f178.google.com (mail-gh0-f178.google.com [209.85.160.178]) by mx.google.com with ESMTPS id v9si5500295ani.169.2012.08.06.04.58.17 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Aug 2012 04:58:18 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.178 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.160.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.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-gh0-f178.google.com with SMTP id f1so2748701ghb.37 for ; Mon, 06 Aug 2012 04:58:17 -0700 (PDT) Received: by 10.66.72.5 with SMTP id z5mr17655381pau.17.1344254297433; Mon, 06 Aug 2012 04:58:17 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id sk5sm8844705pbc.7.2012.08.06.04.58.14 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Aug 2012 04:58:16 -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 17/27] ASoC: wm8978: Use module_i2c_driver Date: Mon, 6 Aug 2012 17:25:50 +0530 Message-Id: <1344254160-6615-18-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: ALoCoQkpoHlQc4y0sn7+Gbl41qshnX/Zw54q5VbXVqD5bzFo0271D2CRWGQr4ik6BfRQdES/WWij module_i2c_driver makes the code simpler by eliminating module_init and module_exit calls. Signed-off-by: Sachin Kamat --- sound/soc/codecs/wm8978.c | 18 +----------------- 1 files changed, 1 insertions(+), 17 deletions(-) diff --git a/sound/soc/codecs/wm8978.c b/sound/soc/codecs/wm8978.c index a5be3ad..5421fd9 100644 --- a/sound/soc/codecs/wm8978.c +++ b/sound/soc/codecs/wm8978.c @@ -1105,23 +1105,7 @@ static struct i2c_driver wm8978_i2c_driver = { .id_table = wm8978_i2c_id, }; -static int __init wm8978_modinit(void) -{ - int ret = 0; - ret = i2c_add_driver(&wm8978_i2c_driver); - if (ret != 0) { - printk(KERN_ERR "Failed to register WM8978 I2C driver: %d\n", - ret); - } - return ret; -} -module_init(wm8978_modinit); - -static void __exit wm8978_exit(void) -{ - i2c_del_driver(&wm8978_i2c_driver); -} -module_exit(wm8978_exit); +module_i2c_driver(wm8978_i2c_driver); MODULE_DESCRIPTION("ASoC WM8978 codec driver"); MODULE_AUTHOR("Guennadi Liakhovetski ");