[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230816095357.2896080-1-ruanjinjie@huawei.com>
Date: Wed, 16 Aug 2023 17:53:56 +0800
From: Ruan Jinjie <ruanjinjie@...wei.com>
To: <netdev@...r.kernel.org>, Rafał Miłecki
<rafal@...ecki.pl>, Broadcom internal kernel review list
<bcm-kernel-feedback-list@...adcom.com>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski
<kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Doug Berger
<opendmb@...il.com>, Florian Fainelli <florian.fainelli@...adcom.com>
CC: <ruanjinjie@...wei.com>
Subject: [PATCH -next] net: broadcom: Use helper function IS_ERR_OR_NULL()
Use IS_ERR_OR_NULL() instead of open-coding it
to simplify the code.
Signed-off-by: Ruan Jinjie <ruanjinjie@...wei.com>
---
drivers/net/ethernet/broadcom/bgmac.c | 2 +-
drivers/net/ethernet/broadcom/genet/bcmmii.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
index 10c7c232cc4e..4cd7c6abb548 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_OR_NULL(phy_dev)) {
dev_err(bgmac->dev, "Failed to register fixed PHY device\n");
return -ENODEV;
}
diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c
index 0092e46c46f8..aa9a436fb3ce 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmmii.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c
@@ -617,7 +617,7 @@ static int bcmgenet_mii_pd_init(struct bcmgenet_priv *priv)
};
phydev = fixed_phy_register(PHY_POLL, &fphy_status, NULL);
- if (!phydev || IS_ERR(phydev)) {
+ if (IS_ERR_OR_NULL(phydev)) {
dev_err(kdev, "failed to register fixed PHY device\n");
return -ENODEV;
}
--
2.34.1
Powered by blists - more mailing lists