Skip to content

Commit a916d72

Browse files
Li Zetaolag-linaro
authored andcommitted
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 <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent 74cd23e commit a916d72

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

drivers/leds/uleds.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -209,17 +209,7 @@ static struct miscdevice uleds_misc = {
209209
.name = ULEDS_NAME,
210210
};
211211

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);
223213

224214
MODULE_AUTHOR("David Lechner <[email protected]>");
225215
MODULE_DESCRIPTION("Userspace driver for the LED subsystem");

0 commit comments

Comments
 (0)