[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230818070707.3670245-2-ruanjinjie@huawei.com>
Date: Fri, 18 Aug 2023 15:07:05 +0800
From: Ruan Jinjie <ruanjinjie@...wei.com>
To: <rafal@...ecki.pl>, <bcm-kernel-feedback-list@...adcom.com>,
<davem@...emloft.net>, <edumazet@...gle.com>, <kuba@...nel.org>,
<pabeni@...hat.com>, <opendmb@...il.com>, <florian.fainelli@...adcom.com>,
<bryan.whitehead@...rochip.com>, <UNGLinuxDriver@...rochip.com>,
<netdev@...r.kernel.org>
CC: <ruanjinjie@...wei.com>
Subject: [PATCH net-next v3 1/3] net: bgmac: Return PTR_ERR() for fixed_phy_register()
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: Ruan Jinjie <ruanjinjie@...wei.com>
Reviewed-by: Andrew Lunn <andrew@...n.ch>
---
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 10c7c232cc4e..7c19ba58e9cc 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 (!phy_dev || 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
Powered by blists - more mailing lists