All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: phy: leds: Trigger leds only if PHY speed is known
@ 2021-07-16 14:11 Ivan T. Ivanov
  2021-07-16 15:19 ` Andrew Lunn
  0 siblings, 1 reply; 7+ messages in thread
From: Ivan T. Ivanov @ 2021-07-16 14:11 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Heiner Kallweit, Russell King, David S . Miller, Jakub Kicinski,
	netdev, linux-kernel

This prevents "No phy led trigger registered for speed(-1)"
alert message which is coused by phy_led_trigger_chage_speed()
being called during attaching phy to net_device where phy device
speed could be still unknown.

Signed-off-by: Ivan T. Ivanov <iivanov@suse.de>
---
 drivers/net/phy/phy_led_triggers.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/phy_led_triggers.c b/drivers/net/phy/phy_led_triggers.c
index f550576eb9da..4d6497c45ae4 100644
--- a/drivers/net/phy/phy_led_triggers.c
+++ b/drivers/net/phy/phy_led_triggers.c
@@ -33,7 +33,7 @@ void phy_led_trigger_change_speed(struct phy_device *phy)
 	if (!phy->link)
 		return phy_led_trigger_no_link(phy);
 
-	if (phy->speed == 0)
+	if (phy->speed == 0 || phy->speed == SPEED_UNKNOWN)
 		return;
 
 	plt = phy_speed_to_led_trigger(phy, phy->speed);
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-08-11 22:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-16 14:11 [PATCH] net: phy: leds: Trigger leds only if PHY speed is known Ivan T. Ivanov
2021-07-16 15:19 ` Andrew Lunn
     [not found]   ` <162646032060.16633.4902744414139431224@localhost>
2021-07-19 15:29     ` Russell King (Oracle)
     [not found]       ` <162737250593.8289.392757192031571742@localhost>
     [not found]         ` <162806599009.5748.14837844278631256325@localhost>
2021-08-09 14:16           ` Russell King (Oracle)
     [not found]             ` <162867546407.30043.9226294532918992883@localhost>
2021-08-11 14:39               ` Andrew Lunn
2021-08-11 15:10               ` Russell King (Oracle)
2021-08-11 22:23             ` Andrew Lunn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.