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 <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>
1 parent 74cd23e commit a916d72

1 file changed

Lines changed: 1 addition & 11 deletions

File tree

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 <david@lechnology.com>");
225215
MODULE_DESCRIPTION("Userspace driver for the LED subsystem");

0 commit comments

Comments
 (0)