From: Dmitry Torokhov 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> References: <1354008098-26346-1-git-send-email-dmitry.torokhov@gmail.com> Return-path: In-Reply-To: <1354008098-26346-1-git-send-email-dmitry.torokhov@gmail.com> Sender: linux-kernel-owner@vger.kernel.org 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 List-Id: linux-input@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