Commit e8fbcc47 authored by Andrew Lunn's avatar Andrew Lunn Committed by Jakub Kicinski

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: default avatarDaniel Golle <daniel@makrotopia.org>
Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Tested-by: default avatarDaniel Golle <daniel@makrotopia.org>
Link: https://lore.kernel.org/r/20230808210436.838995-5-andrew@lunn.chSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 460b0b64
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment