summaryrefslogtreecommitdiff
path: root/drivers/usb/core
diff options
context:
space:
mode:
authorLi Zetao <lizetao1@huawei.com>2023-08-15 10:46:48 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-08-22 15:44:23 +0300
commit20deab8bfc936063385fdce19287f1f630cb2f4b (patch)
treef1d2f3cdf48e9da5cdf280628961354f5a899df7 /drivers/usb/core
parent1fa206bb764f37d2ab4bf671e483153ef0659b34 (diff)
downloadlinux-20deab8bfc936063385fdce19287f1f630cb2f4b.tar.xz
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>
Diffstat (limited to 'drivers/usb/core')
-rw-r--r--drivers/usb/core/ledtrig-usbport.c13
1 files changed, 1 insertions, 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@milecki.pl>");
MODULE_DESCRIPTION("USB port trigger");