ramips: fix cd-poll sd card remove randomly
[openwrt/openwrt.git] / target / linux / generic / patches-4.9 / 702-phy_add_aneg_done_function.patch
index 410cd43067f69287dc9d6105db785c22f22e4853..5c0c22e25393ac74ceb0d581b07d38cd4b496985 100644 (file)
@@ -1,6 +1,6 @@
 --- a/include/linux/phy.h
 +++ b/include/linux/phy.h
-@@ -496,6 +496,12 @@ struct phy_driver {
+@@ -499,6 +499,12 @@ struct phy_driver {
        /* Determines the negotiated speed and duplex */
        int (*read_status)(struct phy_device *phydev);
  
  
 --- a/drivers/net/phy/phy_device.c
 +++ b/drivers/net/phy/phy_device.c
-@@ -1247,6 +1247,9 @@ int genphy_update_link(struct phy_device
+@@ -1309,6 +1309,9 @@ int genphy_update_link(struct phy_device
  {
        int status;
  
-+      if (phydev->drv->update_link)
++      if (phydev->drv && phydev->drv->update_link)
 +              return phydev->drv->update_link(phydev);
 +
        /* Do a fake read */