提交 ab8eb798 编写于 作者: M Miaoqian Lin 提交者: David S. Miller

net: bcmgenet: Fix NULL vs IS_ERR() checking

The phy_attach() function does not return NULL. It returns error pointers.
Signed-off-by: NMiaoqian Lin <linmq006@gmail.com>
Acked-by: NFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 c062f2a0
......@@ -589,9 +589,9 @@ static int bcmgenet_mii_pd_init(struct bcmgenet_priv *priv)
* Internal or external PHY with MDIO access
*/
phydev = phy_attach(priv->dev, phy_name, pd->phy_interface);
if (!phydev) {
if (IS_ERR(phydev)) {
dev_err(kdev, "failed to register PHY device\n");
return -ENODEV;
return PTR_ERR(phydev);
}
} else {
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册