提交 752b0694 编写于 作者: S Salil Mehta 提交者: David S. Miller

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: 256727da ("net: hns3: Add MDIO support to HNS3 Ethernet
Driver for hip08 SoC")
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NSalil Mehta <salil.mehta@huawei.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 dc8007e8
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册