Skip to content

Commit 32bbe64

Browse files
Ruan Jinjiedavem330
authored andcommitted
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: b0ba512 ("net: bcmgenet: enable driver to work without a device tree") Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Acked-by: Doug Berger <opendmb@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 23a1448 commit 32bbe64

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/ethernet/broadcom/genet

1 file changed

+1
-1
lines changed

drivers/net/ethernet/broadcom/genet/bcmmii.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ static int bcmgenet_mii_pd_init(struct bcmgenet_priv *priv)
617617
};
618618

619619
phydev = fixed_phy_register(PHY_POLL, &fphy_status, NULL);
620-
if (!phydev || IS_ERR(phydev)) {
620+
if (IS_ERR(phydev)) {
621621
dev_err(kdev, "failed to register fixed PHY device\n");
622622
return -ENODEV;
623623
}

0 commit comments

Comments
 (0)