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@xxxxxxxxxx> --- drivers/usb/core/ledtrig-usbport.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/usb/core/ledtrig-usbport.c b/drivers/usb/core/ledtrig-usbport.c index ba371a24ff78..85c999f71ad7 100644 --- a/drivers/usb/core/ledtrig-usbport.c +++ b/drivers/usb/core/ledtrig-usbport.c @@ -350,18 +350,7 @@ static struct led_trigger usbport_led_trigger = { .deactivate = usbport_trig_deactivate, }; -static int __init usbport_trig_init(void) -{ - return led_trigger_register(&usbport_led_trigger); -} - -static void __exit usbport_trig_exit(void) -{ - led_trigger_unregister(&usbport_led_trigger); -} - -module_init(usbport_trig_init); -module_exit(usbport_trig_exit); +module_led_trigger(usbport_led_trigger); MODULE_AUTHOR("Rafał Miłecki <rafal@xxxxxxxxxx>"); MODULE_DESCRIPTION("USB port trigger"); -- 2.34.1