summaryrefslogtreecommitdiffstats
path: root/drivers/leds/trigger/ledtrig-netdev.c
diff options
context:
space:
mode:
authorLi Zetao <lizetao1@huawei.com>2023-08-15 09:59:43 +0200
committerLee Jones <lee@kernel.org>2023-08-18 12:42:05 +0200
commit74cd23e87d7b5ebd5185d3930a7d95fbd859a256 (patch)
tree712ae61f154f9565c1eca899bf3f8af5ccf3b975 /drivers/leds/trigger/ledtrig-netdev.c
parentdt-bindings: leds: Fix reference to definition of default-state (diff)
downloadlinux-74cd23e87d7b5ebd5185d3930a7d95fbd859a256.tar.xz
linux-74cd23e87d7b5ebd5185d3930a7d95fbd859a256.zip
leds: trigger: netdev: 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> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://lore.kernel.org/r/20230815075944.1089298-2-lizetao1@huawei.com Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'drivers/leds/trigger/ledtrig-netdev.c')
-rw-r--r--drivers/leds/trigger/ledtrig-netdev.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/leds/trigger/ledtrig-netdev.c b/drivers/leds/trigger/ledtrig-netdev.c
index c9bc5a91ec83..a2835f9fed9d 100644
--- a/drivers/leds/trigger/ledtrig-netdev.c
+++ b/drivers/leds/trigger/ledtrig-netdev.c
@@ -605,18 +605,7 @@ static struct led_trigger netdev_led_trigger = {
.groups = netdev_trig_groups,
};
-static int __init netdev_trig_init(void)
-{
- return led_trigger_register(&netdev_led_trigger);
-}
-
-static void __exit netdev_trig_exit(void)
-{
- led_trigger_unregister(&netdev_led_trigger);
-}
-
-module_init(netdev_trig_init);
-module_exit(netdev_trig_exit);
+module_led_trigger(netdev_led_trigger);
MODULE_AUTHOR("Ben Whitten <ben.whitten@gmail.com>");
MODULE_AUTHOR("Oliver Jowett <oliver@opencloud.com>");