[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230818051221.3634844-2-ruanjinjie@huawei.com>
Date: Fri, 18 Aug 2023 13:12:20 +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>,
<pgynther@...gle.com>, <netdev@...r.kernel.org>
CC: <ruanjinjie@...wei.com>
Subject: [PATCH net v3 1/2] net: bgmac: Fix return value check for fixed_phy_register()
The fixed_phy_register() function returns error pointers and never
returns NULL. Update the checks accordingly.
Fixes: c25b23b8a387 ("bgmac: register fixed PHY for ARM BCM470X / BCM5301X chipsets")
Signed-off-by: Ruan Jinjie <ruanjinjie@...wei.com>
Reviewed-by: Andrew Lunn <andrew@...n.ch>
---
v3:
- Split the err code update code into another patch set as suggested.
v2:
- Remove redundant NULL check and fix the return value.
- Update the commit title and message.
- Add the fix tag.
---
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..52ee3751187a 100644
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -1448,7 +1448,7 @@ int bgmac_phy_connect_direct(struct bgmac *bgmac)
int err;
phy_dev = fixed_phy_register(PHY_POLL, &fphy_status, NULL);
- if (!phy_dev || IS_ERR(phy_dev)) {
+ if (IS_ERR(phy_dev)) {
dev_err(bgmac->dev, "Failed to register fixed PHY device\n");
return -ENODEV;
}
--
2.34.1
Powered by blists - more mailing lists