Thread (7 messages) 7 messages, 2 authors, 2023-08-23

[PATCH net-next v4 1/3] net: bgmac: Return PTR_ERR() for fixed_phy_register()

flat view
STALE1150d REVIEWED: 8 (8M)

From: Jinjie Ruan <hidden>
Date: 2023-08-21 02:50:58
Subsystem: broadcom iproc gbit ethernet driver, networking drivers, the rest · Maintainers: Rafał Miłecki, Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

Revision v4 of 2 in this series; 1 review trailer.

Revisions (2)
  1. v3 [diff vs current]
  2. v4 current
fixed_phy_register() returns -EPROBE_DEFER, -EINVAL and -EBUSY,
etc, in addition to -ENODEV. The best practice is to return
these error codes with PTR_ERR().

Signed-off-by: Jinjie Ruan <redacted>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---
v4:
- Keep the code context consistent with another patch set.
- Update to bring the author's name before.
v3:
- Split the return value check into another patch set.
- Update the commit title and message.
---
 drivers/net/ethernet/broadcom/bgmac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
index 52ee3751187a..448a1b90de5e 100644
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -1450,7 +1450,7 @@ int bgmac_phy_connect_direct(struct bgmac *bgmac)
 	phy_dev = fixed_phy_register(PHY_POLL, &fphy_status, NULL);
 	if (IS_ERR(phy_dev)) {
 		dev_err(bgmac->dev, "Failed to register fixed PHY device\n");
-		return -ENODEV;
+		return PTR_ERR(phy_dev);
 	}
 
 	err = phy_connect_direct(bgmac->net_dev, phy_dev, bgmac_adjust_link,
-- 
2.34.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help