Commit 32bbe64a authored by Ruan Jinjie's avatar Ruan Jinjie Committed by David S. Miller

net: bcmgenet: Fix return value check for fixed_phy_register()

The fixed_phy_register() function returns error pointers and never
returns NULL. Update the checks accordingly.

Fixes: b0ba512e ("net: bcmgenet: enable driver to work without a device tree")
Signed-off-by: default avatarRuan Jinjie <ruanjinjie@huawei.com>
Reviewed-by: default avatarLeon Romanovsky <leonro@nvidia.com>
Acked-by: default avatarDoug Berger <opendmb@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 23a14488
...@@ -617,7 +617,7 @@ static int bcmgenet_mii_pd_init(struct bcmgenet_priv *priv) ...@@ -617,7 +617,7 @@ static int bcmgenet_mii_pd_init(struct bcmgenet_priv *priv)
}; };
phydev = fixed_phy_register(PHY_POLL, &fphy_status, NULL); phydev = fixed_phy_register(PHY_POLL, &fphy_status, NULL);
if (!phydev || IS_ERR(phydev)) { if (IS_ERR(phydev)) {
dev_err(kdev, "failed to register fixed PHY device\n"); dev_err(kdev, "failed to register fixed PHY device\n");
return -ENODEV; return -ENODEV;
} }
......
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