From patchwork Tue Nov 27 05:58:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 13231 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 0B13523E08 for ; Tue, 27 Nov 2012 06:05:25 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id B2F09A192DA for ; Tue, 27 Nov 2012 06:05:24 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id c10so5915385ieb.11 for ; Mon, 26 Nov 2012 22:05:24 -0800 (PST) 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 :mime-version:content-type:content-transfer-encoding :x-gm-message-state; bh=iAUfsx8ZKrYIjFJxWUK8eOW6midhL5SiBvYyg5NB2yA=; b=FKpfq+JsQ43lT82zzgdLnpjn7eUjayJfbxHy0a98Qe0oX2RApFq5JicmHYqBLFpFko SnKpCl8OfajHtsX42poZAUao1ZhaKG/ROII5zSji3IRjpkFzDhd8qFHsYrqL69rFUsOc S0CmsPys/jKRhfILU0eBR4Gs/RorQ5G7wY3HhbE8kvAAVhOTXtI5hf5gfEHh4WZhj8yO HVInlV+F0ZpI9V6AnlPK7eB5XCDEXk/v6KgZyPHLB37dYISpDUM6uvxl9B9xA67sx9yT 5dh7fCQ6atJZplePMpmifx3eKz6Ftmvv6anaqIE8vb89mBbIgM+dlPevFewJwprZaLlp oTzA== Received: by 10.50.186.199 with SMTP id fm7mr14186724igc.62.1353996324493; Mon, 26 Nov 2012 22:05:24 -0800 (PST) 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.67.148 with SMTP id n20csp405073igt; Mon, 26 Nov 2012 22:05:24 -0800 (PST) Received: by 10.68.135.101 with SMTP id pr5mr44833957pbb.140.1353996323940; Mon, 26 Nov 2012 22:05:23 -0800 (PST) Received: from mail-da0-f54.google.com (mail-da0-f54.google.com [209.85.210.54]) by mx.google.com with ESMTPS id d7si603657paw.298.2012.11.26.22.05.23 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 26 Nov 2012 22:05:23 -0800 (PST) Received-SPF: neutral (google.com: 209.85.210.54 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.210.54; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.54 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-da0-f54.google.com with SMTP id n2so3342785dad.13 for ; Mon, 26 Nov 2012 22:05:23 -0800 (PST) Received: by 10.68.134.130 with SMTP id pk2mr45082004pbb.31.1353996323697; Mon, 26 Nov 2012 22:05:23 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id nf9sm10064758pbc.17.2012.11.26.22.05.20 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 26 Nov 2012 22:05:22 -0800 (PST) From: Sachin Kamat To: linux-kernel@vger.kernel.org Cc: cbou@mail.ru, cbouatmailru@gmail.com, dwmw2@infradead.org, sachin.kamat@linaro.org, patches@linaro.org Subject: =?UTF-8?q?=5BPATCH=202/3=5D=20power=3A=20bq2415x=5Fcharger=3A=20Use=20module=5Fi2c=5Fdriver?= Date: Tue, 27 Nov 2012 11:28:45 +0530 Message-Id: <1353995926-4621-3-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1353995926-4621-1-git-send-email-sachin.kamat@linaro.org> References: <1353995926-4621-1-git-send-email-sachin.kamat@linaro.org> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQlUI0QVaelsRG41S2t1VWU1dDpPTv88JDnuu6zMLQV93P9n20ylJLDxb8K/AilLd4z4aucZ module_i2c_driver() makes the code simpler by eliminating module_init and module_exit calls. Signed-off-by: Sachin Kamat --- drivers/power/bq2415x_charger.c | 12 +----------- 1 files changed, 1 insertions(+), 11 deletions(-) diff --git a/drivers/power/bq2415x_charger.c b/drivers/power/bq2415x_charger.c index 2d1b568..54c4ebf 100644 --- a/drivers/power/bq2415x_charger.c +++ b/drivers/power/bq2415x_charger.c @@ -1652,17 +1652,7 @@ static struct i2c_driver bq2415x_driver = { .id_table = bq2415x_i2c_id_table, }; -static int __init bq2415x_init(void) -{ - return i2c_add_driver(&bq2415x_driver); -} -module_init(bq2415x_init); - -static void __exit bq2415x_exit(void) -{ - i2c_del_driver(&bq2415x_driver); -} -module_exit(bq2415x_exit); +module_i2c_driver(bq2415x_driver); MODULE_AUTHOR("Pali Rohár "); MODULE_DESCRIPTION("bq2415x charger driver");