]> Git Repo - J-linux.git/commitdiff
leds: uleds: Use module_misc_device macro to simplify the code
authorLi Zetao <[email protected]>
Tue, 15 Aug 2023 07:59:44 +0000 (15:59 +0800)
committerLee Jones <[email protected]>
Fri, 18 Aug 2023 10:42:54 +0000 (11:42 +0100)
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 <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Lee Jones <[email protected]>
drivers/leds/uleds.c

index 7320337b22d2cf6bd6324c713c6ef032e77c6cb3..3d361c9200302e87330615316eb2dbc10b83d244 100644 (file)
@@ -209,17 +209,7 @@ static struct miscdevice uleds_misc = {
        .name           = ULEDS_NAME,
 };
 
-static int __init uleds_init(void)
-{
-       return misc_register(&uleds_misc);
-}
-module_init(uleds_init);
-
-static void __exit uleds_exit(void)
-{
-       misc_deregister(&uleds_misc);
-}
-module_exit(uleds_exit);
+module_misc_device(uleds_misc);
 
 MODULE_AUTHOR("David Lechner <[email protected]>");
 MODULE_DESCRIPTION("Userspace driver for the LED subsystem");
This page took 0.052704 seconds and 4 git commands to generate.