Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

leds: uleds: Use module_misc_device macro to simplify the code

Use the module_misc_device macro to simplify the code, which is the
same as declaring with module_init() and module_exit().

Signed-off-by: Li Zetao <lizetao1@huawei.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20230815075944.1089298-3-lizetao1@huawei.com
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Li Zetao and committed by
Lee Jones
a916d720 74cd23e8

+1 -11
+1 -11
drivers/leds/uleds.c
··· 209 209 .name = ULEDS_NAME, 210 210 }; 211 211 212 - static int __init uleds_init(void) 213 - { 214 - return misc_register(&uleds_misc); 215 - } 216 - module_init(uleds_init); 217 - 218 - static void __exit uleds_exit(void) 219 - { 220 - misc_deregister(&uleds_misc); 221 - } 222 - module_exit(uleds_exit); 212 + module_misc_device(uleds_misc); 223 213 224 214 MODULE_AUTHOR("David Lechner <david@lechnology.com>"); 225 215 MODULE_DESCRIPTION("Userspace driver for the LED subsystem");