kernel/3.1[02]: move MTD root device setup code to mtdcore
[openwrt/svn-archive/archive.git] / target / linux / generic / patches-3.10 / 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 @@ -612,6 +612,9 @@ EXPORT_SYMBOL(phy_attach);
4 */
5 void phy_detach(struct phy_device *phydev)
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
13 --- a/include/linux/phy.h
14 +++ b/include/linux/phy.h
15 @@ -432,6 +432,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