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

usb: core: Use module_led_trigger macro to simplify the code

Use the module_led_trigger 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>
Link: https://lore.kernel.org/r/20230815074648.1015175-1-lizetao1@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Li Zetao and committed by
Greg Kroah-Hartman
20deab8b 1fa206bb

+1 -12
+1 -12
drivers/usb/core/ledtrig-usbport.c
··· 350 350 .deactivate = usbport_trig_deactivate, 351 351 }; 352 352 353 - static int __init usbport_trig_init(void) 354 - { 355 - return led_trigger_register(&usbport_led_trigger); 356 - } 357 - 358 - static void __exit usbport_trig_exit(void) 359 - { 360 - led_trigger_unregister(&usbport_led_trigger); 361 - } 362 - 363 - module_init(usbport_trig_init); 364 - module_exit(usbport_trig_exit); 353 + module_led_trigger(usbport_led_trigger); 365 354 366 355 MODULE_AUTHOR("Rafał Miłecki <rafal@milecki.pl>"); 367 356 MODULE_DESCRIPTION("USB port trigger");