netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: netdev <netdev@vger.kernel.org>
Cc: Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <rmk+kernel@armlinux.org.uk>,
	Simon Horman <simon.horman@corigine.com>,
	Christian Marangi <ansuelsmth@gmail.com>,
	Daniel Golle <daniel@makrotopia.org>,
	Andrew Lunn <andrew@lunn.ch>
Subject: [PATCH net-next v3 4/4] leds: trig-netdev: Disable offload on deactivation of trigger
Date: Tue,  8 Aug 2023 23:04:36 +0200	[thread overview]
Message-ID: <20230808210436.838995-5-andrew@lunn.ch> (raw)
In-Reply-To: <20230808210436.838995-1-andrew@lunn.ch>

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(+)

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


  parent reply	other threads:[~2023-08-08 21:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-08 21:04 [PATCH net-next v3 0/4] Support offload LED blinking to PHY Andrew Lunn
2023-08-08 21:04 ` [PATCH net-next v3 1/4] led: trig: netdev: Fix requesting offload device Andrew Lunn
2023-08-08 21:04 ` [PATCH net-next v3 2/4] net: phy: phy_device: Call into the PHY driver to set LED offload Andrew Lunn
2023-08-08 21:04 ` [PATCH net-next v3 3/4] net: phy: marvell: Add support for offloading LED blinking Andrew Lunn
2023-08-08 21:04 ` Andrew Lunn [this message]
2023-08-09  7:46   ` [PATCH net-next v3 4/4] leds: trig-netdev: Disable offload on deactivation of trigger Simon Horman
2023-08-09 16:10 ` [PATCH net-next v3 0/4] Support offload LED blinking to PHY Daniel Golle
2023-08-09 16:27   ` Andrew Lunn
2023-08-11  0:40 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230808210436.838995-5-andrew@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=ansuelsmth@gmail.com \
    --cc=daniel@makrotopia.org \
    --cc=hkallweit1@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=simon.horman@corigine.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).