kernel: update kernel 4.14 to 4.14.32
[openwrt/staging/chunkeey.git] / target / linux / mvebu / patches-4.14 / 450-reprobe_sfp_phy.patch
index a9a6634c233200e6e2e54e93e0f72cf197452cc8..e9a3d695dad3d636549be29a9ece3ac2adbeaa7d 100644 (file)
@@ -22,20 +22,16 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
  {
        struct phy_device *phy;
        int err;
-@@ -497,12 +497,12 @@ static void sfp_sm_probe_phy(struct sfp
+@@ -498,11 +498,11 @@ static void sfp_sm_probe_phy(struct sfp
        phy = mdiobus_scan(sfp->i2c_mii, SFP_PHY_ADDR);
+       if (phy == ERR_PTR(-ENODEV)) {
+               dev_info(sfp->dev, "no PHY detected\n");
+-              return;
++              return -EAGAIN;
+       }
        if (IS_ERR(phy)) {
-+              if (PTR_ERR(phy) == -ENODEV) {
-+                      dev_dbg(sfp->dev, "no PHY detected\n");
-+                      return -EAGAIN;
-+              }
                dev_err(sfp->dev, "mdiobus scan returned %ld\n", PTR_ERR(phy));
 -              return;
--      }
--      if (!phy) {
--              dev_info(sfp->dev, "no PHY detected\n");
--              return;
 +              return PTR_ERR(phy);
        }