kernel: update 3.18 to 3.18.1
[openwrt.git] / target / linux / generic / patches-3.18 / 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 @@ -674,6 +674,9 @@ void phy_detach(struct phy_device *phyde
4  {
5         int i;
6  
7 +       if (phydev->drv && phydev->drv->detach)
8 +               phydev->drv->detach(phydev);
9 +
10         if (phydev->bus->dev.driver)
11                 module_put(phydev->bus->dev.driver->owner);
12  
13 --- a/include/linux/phy.h
14 +++ b/include/linux/phy.h
15 @@ -502,6 +502,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