Commit 412a75dc authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'fixed_phy_register-return-value'



Ruan Jinjie says:

====================
net: Return PTR_ERR() for fixed_phy_register()

fixed_phy_register() returns not only -EIO or -ENODEV, but also
-EPROBE_DEFER, -EINVAL and -EBUSY. The Best practice is to return these
error codes with PTR_ERR().
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents b22eef68 294f48e9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1450,7 +1450,7 @@ int bgmac_phy_connect_direct(struct bgmac *bgmac)
	phy_dev = fixed_phy_register(PHY_POLL, &fphy_status, NULL);
	if (!phy_dev || IS_ERR(phy_dev)) {
		dev_err(bgmac->dev, "Failed to register fixed PHY device\n");
		return -ENODEV;
		return PTR_ERR(phy_dev);
	}

	err = phy_connect_direct(bgmac->net_dev, phy_dev, bgmac_adjust_link,
+1 −1
Original line number Diff line number Diff line
@@ -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 */
+1 −1
Original line number Diff line number Diff line
@@ -1515,7 +1515,7 @@ static int lan743x_phy_open(struct lan743x_adapter *adapter)
							    &fphy_status, NULL);
				if (IS_ERR(phydev)) {
					netdev_err(netdev, "No PHY/fixed_PHY found\n");
					return -EIO;
					return PTR_ERR(phydev);
				}
			} else {
				goto return_error;