aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorSalil Mehta <salil.mehta@huawei.com>2017-08-30 12:06:03 +0100
committerDavid S. Miller <davem@davemloft.net>2017-08-30 15:29:42 -0700
commit752b06946cc99534a7a4a11b7196e9a1e3d7e098 (patch)
tree26d8518599d39c0fc0ec92c6cdb5ed357b86209a /drivers/net/ethernet
parentnet: bcm63xx_enet: make bcm_enetsw_ethtool_ops const (diff)
downloadlinux-dev-752b06946cc99534a7a4a11b7196e9a1e3d7e098.tar.xz
linux-dev-752b06946cc99534a7a4a11b7196e9a1e3d7e098.zip
net: hns3: Fixes the wrong IS_ERR check on the returned phydev value
This patch removes the wrong check being done for the phy device being returned by the mdiobus_get_phy() function. This function never returns the error pointers. Fixes: 256727da7395 ("net: hns3: Add MDIO support to HNS3 Ethernet Driver for hip08 SoC") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Salil Mehta <salil.mehta@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c
index a2add8bb1945..f32d719c4f77 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c
@@ -150,7 +150,7 @@ int hclge_mac_mdio_config(struct hclge_dev *hdev)
}
phydev = mdiobus_get_phy(mdio_bus, mac->phy_addr);
- if (!phydev || IS_ERR(phydev)) {
+ if (!phydev) {
dev_err(mdio_bus->parent, "Failed to get phy device\n");
mdiobus_unregister(mdio_bus);
return -EIO;