diff mbox series

[net-next,v3,4/4] leds: trig-netdev: Disable offload on deactivation of trigger

Message ID 20230808210436.838995-5-andrew@lunn.ch (mailing list archive)
State Accepted
Commit e8fbcc47a8e935f36f044d85f21a99acecbd7bfb
Delegated to: Netdev Maintainers
Headers show
Series Support offload LED blinking to PHY. | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1330 this patch: 1330
netdev/cc_maintainers warning 4 maintainers not CCed: lee@kernel.org davem@davemloft.net pavel@ucw.cz linux-leds@vger.kernel.org
netdev/build_clang success Errors and warnings before: 1353 this patch: 1353
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1353 this patch: 1353
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Andrew Lunn Aug. 8, 2023, 9:04 p.m. UTC
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>
---
 drivers/leds/trigger/ledtrig-netdev.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Simon Horman Aug. 9, 2023, 7:46 a.m. UTC | #1
On Tue, Aug 08, 2023 at 11:04:36PM +0200, Andrew Lunn wrote:
> 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>
diff mbox series

Patch

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);