From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933286Ab2K0JWS (ORCPT ); Tue, 27 Nov 2012 04:22:18 -0500 Received: from mail-pa0-f46.google.com ([209.85.220.46]:38243 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758544Ab2K0JVr (ORCPT ); Tue, 27 Nov 2012 04:21:47 -0500 From: Dmitry Torokhov To: Christopher Heiny Cc: Linus Walleij , Linux Input , Linux Kernel , Allie Xiong , Vivian Ly , Daniel Rosenberg , Alexandra Chin , Joerie de Gram , Wolfram Sang , Mathieu Poirier , Naveen Kumar Gaddipati Subject: [PATCH 4/4] Input: RMI4 - introduce rmi_module_driver() macro Date: Tue, 27 Nov 2012 01:21:38 -0800 Message-Id: <1354008098-26346-4-git-send-email-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1354008098-26346-1-git-send-email-dmitry.torokhov@gmail.com> References: <1354008098-26346-1-git-send-email-dmitry.torokhov@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This also allows us to cut down on the boilerplate code in the function handler modules. Signed-off-by: Dmitry Torokhov --- drivers/input/rmi4/rmi_f11.c | 13 +------------ include/linux/rmi.h | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/drivers/input/rmi4/rmi_f11.c b/drivers/input/rmi4/rmi_f11.c index dbb6060..8457ab4 100644 --- a/drivers/input/rmi4/rmi_f11.c +++ b/drivers/input/rmi4/rmi_f11.c @@ -2756,18 +2756,7 @@ static struct rmi_function_handler rmi_f11_handler = { #endif /* defined(CONFIG_HAS_EARLYSUSPEND) */ }; -static int __init rmi_f11_module_init(void) -{ - return rmi_register_function_handler(&rmi_f11_handler); -} - -static void __exit rmi_f11_module_exit(void) -{ - rmi_unregister_function_handler(&rmi_f11_handler); -} - -module_init(rmi_f11_module_init); -module_exit(rmi_f11_module_exit); +module_rmi_driver(rmi_f11_handler); MODULE_AUTHOR("Christopher Heiny