From patchwork Mon Oct 8 14:15:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 1566061 Return-Path: X-Original-To: patchwork-linux-input@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 CC4F340135 for ; Mon, 8 Oct 2012 14:15:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751477Ab2JHOPq (ORCPT ); Mon, 8 Oct 2012 10:15:46 -0400 Received: from mail-qa0-f53.google.com ([209.85.216.53]:33895 "EHLO mail-qa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750845Ab2JHOPp (ORCPT ); Mon, 8 Oct 2012 10:15:45 -0400 Received: by mail-qa0-f53.google.com with SMTP id s11so1943643qaa.19 for ; Mon, 08 Oct 2012 07:15:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=qxE7ExQQiMvgsG3KhV8OSfApBfo8WLWiA1CxqhHd7P8=; b=bskkJ5qztKh6vIlV5YO+rlV0Z6jbwOFPpjgc04h2K/BZU6x7Y5tOokdH0CvSvhy8qo HKBUZkn7XXOd+I0qKGiS9I4m2DQ8kFaaJpWfUEMR4X49Ms7ZnYWy14GUpafdT+Je6dlR 3bTC9OJUW9EX5Ph4WtMGXCT9lR60E4MmqNaYqHff2gJX3hGDhQwF9Rin5iO5WrGL/Mf5 MsJVqDM1Kte3DrNscz0wFu7mbwV1MqW7ui9WIy0Q+GDTCMnov2t5LrxWr9U8Gpeke8Gv +uwF62OaHWDWUdmsJh2Ahh+ArTIFGhduS2rrXal1WUNlECBWvgL/BpSrB41gAq69hHhi FTQQ== MIME-Version: 1.0 Received: by 10.49.85.202 with SMTP id j10mr42753356qez.59.1349705744788; Mon, 08 Oct 2012 07:15:44 -0700 (PDT) Received: by 10.229.146.194 with HTTP; Mon, 8 Oct 2012 07:15:44 -0700 (PDT) Date: Mon, 8 Oct 2012 22:15:44 +0800 Message-ID: Subject: [PATCH] staging: ste_rmi4: use module_i2c_driver to simplify the code From: Wei Yongjun To: gregkh@linuxfoundation.org, rydberg@euromail.se Cc: yongjun_wei@trendmicro.com.cn, devel@driverdev.osuosl.org, linux-input@vger.kernel.org Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Wei Yongjun Use the module_i2c_driver() macro to make the code smaller and a bit simpler. dpatch engine is used to auto generate this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun Acked-by: Linus Walleij Acked-by: Henrik Rydberg --- drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c index 277491a..37d19c6 100644 --- a/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c +++ b/drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c @@ -1143,30 +1143,8 @@ static struct i2c_driver synaptics_rmi4_driver = { .remove = __devexit_p(synaptics_rmi4_remove), .id_table = synaptics_rmi4_id_table, }; -/** - * synaptics_rmi4_init() - Initialize the touchscreen driver - * - * This function uses to initializes the synaptics - * touchscreen driver and returns integer. - */ -static int __init synaptics_rmi4_init(void) -{ - return i2c_add_driver(&synaptics_rmi4_driver); -} -/** - * synaptics_rmi4_exit() - De-initialize the touchscreen driver - * - * This function uses to de-initialize the synaptics - * touchscreen driver and returns none. - */ -static void __exit synaptics_rmi4_exit(void) -{ - i2c_del_driver(&synaptics_rmi4_driver); -} - -module_init(synaptics_rmi4_init); -module_exit(synaptics_rmi4_exit); +module_i2c_driver(synaptics_rmi4_driver); MODULE_LICENSE("GPL v2"); MODULE_AUTHOR("naveen.gaddipati@stericsson.com, js.ha@stericsson.com");