From 657b465ce20b1d72fd61761d43558529242cc092 Mon Sep 17 00:00:00 2001 From: Russell King Date: Tue, 5 Nov 2019 10:34:39 +0000 Subject: net: phy: make phy_error() report which PHY has failed phy_error() is called from phy_interrupt() or phy_state_machine(), and uses WARN_ON() to print a backtrace. The backtrace is not useful when reporting a PHY error. However, a system may contain multiple ethernet PHYs, and phy_error() gives no clue which one caused the problem. Replace WARN_ON() with a call to phydev_err() so that we can see which PHY had an error, and also inform the user that we are halting the PHY. Signed-off-by: Russell King --- drivers/net/phy/phy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index ce71d5a9b6cc..5aabb792cb4f 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -875,7 +875,7 @@ void phy_stop_machine(struct phy_device *phydev) */ static void phy_error(struct phy_device *phydev) { - WARN_ON(1); + phydev_err(phydev, "Error detected, halting PHY\n"); mutex_lock(&phydev->lock); phydev->state = PHY_HALTED; -- cgit