diff options
author | Andrew Lunn <andrew@lunn.ch> | 2023-08-08 23:04:36 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-08-10 17:35:00 -0700 |
commit | e8fbcc47a8e935f36f044d85f21a99acecbd7bfb (patch) | |
tree | da9c44d53a08c3571871c58a67edaf56984ed9c7 /drivers/leds/trigger | |
parent | 460b0b648fab24f576c481424e0de5479ffb9786 (diff) |
leds: trig-netdev: Disable offload on deactivation of trigger
Ensure that the offloading of blinking is stopped when the trigger is
deactivated. Calling led_set_brightness() is documented as stopping
offload and setting the LED to a constant brightness.
Suggested-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Tested-by: Daniel Golle <daniel@makrotopia.org>
Link: https://lore.kernel.org/r/20230808210436.838995-5-andrew@lunn.ch
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/leds/trigger')
-rw-r--r-- | drivers/leds/trigger/ledtrig-netdev.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/leds/trigger/ledtrig-netdev.c b/drivers/leds/trigger/ledtrig-netdev.c index 3d215a556e20..42f758880ef8 100644 --- a/drivers/leds/trigger/ledtrig-netdev.c +++ b/drivers/leds/trigger/ledtrig-netdev.c @@ -595,6 +595,8 @@ static void netdev_trig_deactivate(struct led_classdev *led_cdev) cancel_delayed_work_sync(&trigger_data->work); + led_set_brightness(led_cdev, LED_OFF); + dev_put(trigger_data->net_dev); kfree(trigger_data); |