[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210716141142.12710-1-iivanov@suse.de>
Date: Fri, 16 Jul 2021 17:11:42 +0300
From: "Ivan T. Ivanov" <iivanov@...e.de>
To: Andrew Lunn <andrew@...n.ch>
Cc: Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
"David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] net: phy: leds: Trigger leds only if PHY speed is known
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@...e.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
Powered by blists - more mailing lists