summaryrefslogtreecommitdiffstats
path: root/arch/arm/common
diff options
context:
space:
mode:
authorPrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>2016-08-25 22:30:49 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-08-31 14:12:35 +0200
commitca75d601b5942e8cf5eed68f308be0526d0dac5d (patch)
treeca411c99f5715a5976eb942a061dfa3b2b6e841d /arch/arm/common
parent832c8232dd7be4977ae9fb9c7cbc4decce19a8fc (diff)
downloadlinux-ca75d601b5942e8cf5eed68f308be0526d0dac5d.tar.bz2
miscdevice: Add helper macro for misc device boilerplate
Many modules call misc_register and misc_deregister in its module init and exit methods without any additional code. This ends up being boilerplate. This patch adds helper macro module_misc_device(), that replaces module_init()/ module_exit() with template functions. This patch also converts drivers to use new macro. Change since v1: Add device.h include in miscdevice.h as module_driver macro was not available from other include files in some architectures. Signed-off-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/arm/common')
-rw-r--r--arch/arm/common/bL_switcher_dummy_if.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/arch/arm/common/bL_switcher_dummy_if.c b/arch/arm/common/bL_switcher_dummy_if.c
index 3f47f1203c6b..6053f64c3752 100644
--- a/arch/arm/common/bL_switcher_dummy_if.c
+++ b/arch/arm/common/bL_switcher_dummy_if.c
@@ -56,16 +56,4 @@ static struct miscdevice bL_switcher_device = {
"b.L_switcher",
&bL_switcher_fops
};
-
-static int __init bL_switcher_dummy_if_init(void)
-{
- return misc_register(&bL_switcher_device);
-}
-
-static void __exit bL_switcher_dummy_if_exit(void)
-{
- misc_deregister(&bL_switcher_device);
-}
-
-module_init(bL_switcher_dummy_if_init);
-module_exit(bL_switcher_dummy_if_exit);
+module_misc_device(bL_switcher_device);