Skip to content

Commit 23a1448

Browse files
Ruan Jinjiedavem330
authored andcommitted
net: bgmac: 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: c25b23b ("bgmac: register fixed PHY for ARM BCM470X / BCM5301X chipsets") Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent a0e026e commit 23a1448

File tree

1 file changed

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

1 file changed

+1
-1
lines changed

drivers/net/ethernet/broadcom/bgmac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1448,7 +1448,7 @@ int bgmac_phy_connect_direct(struct bgmac *bgmac)
14481448
int err;
14491449

14501450
phy_dev = fixed_phy_register(PHY_POLL, &fphy_status, NULL);
1451-
if (!phy_dev || IS_ERR(phy_dev)) {
1451+
if (IS_ERR(phy_dev)) {
14521452
dev_err(bgmac->dev, "Failed to register fixed PHY device\n");
14531453
return -ENODEV;
14541454
}

0 commit comments

Comments
 (0)