From patchwork Sat Dec 8 17:16:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Devendra Naga X-Patchwork-Id: 1853031 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 050AD3FC64 for ; Sat, 8 Dec 2012 17:16:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964986Ab2LHRQa (ORCPT ); Sat, 8 Dec 2012 12:16:30 -0500 Received: from mail-pa0-f46.google.com ([209.85.220.46]:44971 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964947Ab2LHRQ3 (ORCPT ); Sat, 8 Dec 2012 12:16:29 -0500 Received: by mail-pa0-f46.google.com with SMTP id bh2so1137787pad.19 for ; Sat, 08 Dec 2012 09:16:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:mime-version :content-type:content-transfer-encoding; bh=61QERPTdU9S2B5myySA50PeJT/tmmeNUmo1umcIwlqU=; b=jw/46asf8sZFa/+tdqb2qDxe6pNnaJiTVutXqnT9/C0NVfX8uT9tTi+tbQe1zYZeWi TMrls/F8tUZ7w0Xk66YBN1BSMnKoyPYf7m5KxntxI/j0nhywJBm+MlrLhWv4NPmzaCh3 Y60+Q7iKnvKMfNmbTOhhMCLOmMcICsy1f4yc/kTOpQVGjXeWzCStZv59f0Gsb5zTtfmx xcqkD7DWNHmM6rZBp0AUHj8dHtOlewxdiYjgPvoXuz67inOzPErXj5rH4+ze0kgQs9JH q9IeWrSkqg1N62A0P/rOAIkPYZmJFksTdLOlTxpzU0/v8t7d0AZbbMYmFz/GLvZMVtv0 126A== Received: by 10.66.81.42 with SMTP id w10mr22132576pax.66.1354986987308; Sat, 08 Dec 2012 09:16:27 -0800 (PST) Received: from localhost.localdomain ([122.172.32.246]) by mx.google.com with ESMTPS id f2sm8668134paz.25.2012.12.08.09.16.24 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 08 Dec 2012 09:16:26 -0800 (PST) From: Devendra Naga To: Anton Vorontsov , David Woodhouse , linux-pm@vger.kernel.org Cc: Devendra Naga Subject: =?UTF-8?q?=5BPATCH=5D=20power=3A=20bq2414x=3A=20use=20module=5Fi2c=5Fdriver=20macro?= Date: Sat, 8 Dec 2012 12:16:20 -0500 Message-Id: <1354986980-10489-1-git-send-email-develkernel412222@gmail.com> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org use the module_i2c_driver macro and reduce code and also remove the duplicated module init and exit places. Signed-off-by: Devendra Naga --- drivers/power/bq2415x_charger.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/power/bq2415x_charger.c b/drivers/power/bq2415x_charger.c index ee842b3..b05df0a 100644 --- a/drivers/power/bq2415x_charger.c +++ b/drivers/power/bq2415x_charger.c @@ -1653,18 +1653,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"); MODULE_LICENSE("GPL");