diff options
author | PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com> | 2016-08-25 22:30:49 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-08-31 14:12:35 +0200 |
commit | ca75d601b5942e8cf5eed68f308be0526d0dac5d (patch) | |
tree | ca411c99f5715a5976eb942a061dfa3b2b6e841d /arch/blackfin | |
parent | 832c8232dd7be4977ae9fb9c7cbc4decce19a8fc (diff) | |
download | linux-ca75d601b5942e8cf5eed68f308be0526d0dac5d.tar.gz linux-ca75d601b5942e8cf5eed68f308be0526d0dac5d.tar.bz2 linux-ca75d601b5942e8cf5eed68f308be0526d0dac5d.zip |
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/blackfin')
-rw-r--r-- | arch/blackfin/mach-bf561/coreb.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/arch/blackfin/mach-bf561/coreb.c b/arch/blackfin/mach-bf561/coreb.c index 78ecb50bafc8..8a2543c654b3 100644 --- a/arch/blackfin/mach-bf561/coreb.c +++ b/arch/blackfin/mach-bf561/coreb.c @@ -59,18 +59,7 @@ static struct miscdevice coreb_dev = { .name = "coreb", .fops = &coreb_fops, }; - -static int __init bf561_coreb_init(void) -{ - return misc_register(&coreb_dev); -} -module_init(bf561_coreb_init); - -static void __exit bf561_coreb_exit(void) -{ - misc_deregister(&coreb_dev); -} -module_exit(bf561_coreb_exit); +module_misc_device(coreb_dev); MODULE_AUTHOR("Bas Vermeulen <bvermeul@blackstar.xs4all.nl>"); MODULE_DESCRIPTION("BF561 Core B Support"); |