kernel: add linux 4.4 support
[openwrt.git] / target / linux / generic / patches-4.4 / 703-phy-add-detach-callback-to-struct-phy_driver.patch
1 --- a/drivers/net/phy/phy_device.c
2 +++ b/drivers/net/phy/phy_device.c
3 @@ -734,6 +734,9 @@ void phy_detach(struct phy_device *phyde
4         struct mii_bus *bus;
5         int i;
6  
7 +       if (phydev->drv && phydev->drv->detach)
8 +               phydev->drv->detach(phydev);
9 +
10         phydev->attached_dev->phydev = NULL;
11         phydev->attached_dev = NULL;
12         phy_suspend(phydev);
13 --- a/include/linux/phy.h
14 +++ b/include/linux/phy.h
15 @@ -519,6 +519,12 @@ struct phy_driver {
16          */
17         int (*did_interrupt)(struct phy_device *phydev);
18  
19 +       /*
20 +        * Called before an ethernet device is detached
21 +        * from the PHY.
22 +        */
23 +       void (*detach)(struct phy_device *phydev);
24 +
25         /* Clears up any memory if needed */
26         void (*remove)(struct phy_device *phydev);
27