From: Ruan Jinjie Date: Fri, 18 Aug 2023 07:07:06 +0000 (+0800) Subject: net: bcmgenet: Return PTR_ERR() for fixed_phy_register() X-Git-Tag: v6.6.17~4098^2~70^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=acf50d1adbf440a01fc9cca16e80dde3da3eccab;p=platform%2Fkernel%2Flinux-rpi.git net: bcmgenet: 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 Acked-by: Doug Berger Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c index 0092e46..4012a14 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmmii.c +++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c @@ -619,7 +619,7 @@ static int bcmgenet_mii_pd_init(struct bcmgenet_priv *priv) phydev = fixed_phy_register(PHY_POLL, &fphy_status, NULL); if (!phydev || IS_ERR(phydev)) { dev_err(kdev, "failed to register fixed PHY device\n"); - return -ENODEV; + return PTR_ERR(phydev); } /* Make sure we initialize MoCA PHYs with a link down */