summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHongbo Li <lihongbo22@huawei.com>2024-08-28 20:23:36 +0800
committerJakub Kicinski <kuba@kernel.org>2024-08-29 11:42:24 -0700
commit4266563afbb1eb1735aa7063fe8ff6377991ae42 (patch)
treeb36999dc79d606ced4b64366da37bb113edfd51b
parent9023fda2f186168e45bb8e7397ad15ff17fd7bf8 (diff)
net: hns: Use IS_ERR_OR_NULL() helper function
Use the IS_ERR_OR_NULL() helper instead of open-coding a NULL and an error pointer checks to simplify the code and improve readability. Signed-off-by: Hongbo Li <lihongbo22@huawei.com> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Link: https://patch.msgid.link/20240828122336.3697176-1-lihongbo22@huawei.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
index 616a2768e504..58baac7103b3 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
@@ -734,7 +734,7 @@ hns_mac_register_phydev(struct mii_bus *mdio, struct hns_mac_cb *mac_cb,
return -ENODATA;
phy = get_phy_device(mdio, addr, is_c45);
- if (!phy || IS_ERR(phy))
+ if (IS_ERR_OR_NULL(phy))
return -EIO;
phy->irq = mdio->irq[addr];