[PATCH net-next v3 2/7] net: usb: lan78xx: improve error reporting on PHY attach failure

Oleksij Rempel
2025-03-10T11:57:48Z

Include error code in the log message when PHY attachment fails,
providing better debugging information.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
changes v3:
- update commit message
---
drivers/net/usb/lan78xx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
index 63b5406bfecb..dd55a9ba78fa 100644
--- a/drivers/net/usb/lan78xx.c
+++ b/drivers/net/usb/lan78xx.c
@@ -2682,8 +2682,8 @@ static int lan78xx_phy_init(struct lan78xx_net *dev)

ret = phylink_connect_phy(dev->phylink, phydev);
if (ret) {
- netdev_err(dev->net, "can't attach PHY to %s\n",
- dev->mdiobus->id);
+ netdev_err(dev->net, "can't attach PHY to %s, error %pe\n",
+ dev->mdiobus->id, ERR_PTR(ret));
return -EIO;
}

--
2.39.5