Skip to content

Commit

Permalink
net: hns3: Fixes the wrong IS_ERR check on the returned phydev value
Browse files Browse the repository at this point in the history
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: 256727d ("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>
  • Loading branch information
Salil Mehta authored and David S. Miller committed Aug 30, 2017
1 parent dc8007e commit 752b069
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 752b069

Please sign in to comment.