Skip to content

Commit d6499f0

Browse files
Ruan Jinjiedavem330
authored andcommitted
net: bgmac: Return PTR_ERR() for fixed_phy_register()
fixed_phy_register() returns -EPROBE_DEFER, -EINVAL and -EBUSY, etc, in addition to -ENODEV. The best practice is to return these error codes with PTR_ERR(). Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent b22eef6 commit d6499f0

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
@@ -1450,7 +1450,7 @@ int bgmac_phy_connect_direct(struct bgmac *bgmac)
14501450
phy_dev = fixed_phy_register(PHY_POLL, &fphy_status, NULL);
14511451
if (!phy_dev || IS_ERR(phy_dev)) {
14521452
dev_err(bgmac->dev, "Failed to register fixed PHY device\n");
1453-
return -ENODEV;
1453+
return PTR_ERR(phy_dev);
14541454
}
14551455

14561456
err = phy_connect_direct(bgmac->net_dev, phy_dev, bgmac_adjust_link,

0 commit comments

Comments
 (0)