Commit ab8eb798 authored by Miaoqian Lin's avatar Miaoqian Lin Committed by 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: default avatarMiaoqian Lin <linmq006@gmail.com>
Acked-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c062f2a0
...@@ -589,9 +589,9 @@ static int bcmgenet_mii_pd_init(struct bcmgenet_priv *priv) ...@@ -589,9 +589,9 @@ static int bcmgenet_mii_pd_init(struct bcmgenet_priv *priv)
* Internal or external PHY with MDIO access * Internal or external PHY with MDIO access
*/ */
phydev = phy_attach(priv->dev, phy_name, pd->phy_interface); 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"); dev_err(kdev, "failed to register PHY device\n");
return -ENODEV; return PTR_ERR(phydev);
} }
} else { } else {
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment