1
0

703-phy-add-detach-callback-to-struct-phy_driver.patch 1021 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. From: Gabor Juhos <juhosg@openwrt.org>
  2. Subject: generic: add detach callback to struct phy_driver
  3. lede-commit: fe61fc2d7d0b3fb348b502f68f98243b3ddf5867
  4. Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
  5. ---
  6. drivers/net/phy/phy_device.c | 3 +++
  7. include/linux/phy.h | 6 ++++++
  8. 2 files changed, 9 insertions(+)
  9. --- a/drivers/net/phy/phy_device.c
  10. +++ b/drivers/net/phy/phy_device.c
  11. @@ -1001,6 +1001,9 @@ void phy_detach(struct phy_device *phyde
  12. struct mii_bus *bus;
  13. int i;
  14. + if (phydev->drv && phydev->drv->detach)
  15. + phydev->drv->detach(phydev);
  16. +
  17. phydev->attached_dev->phydev = NULL;
  18. phydev->attached_dev = NULL;
  19. phy_suspend(phydev);
  20. --- a/include/linux/phy.h
  21. +++ b/include/linux/phy.h
  22. @@ -507,6 +507,12 @@ struct phy_driver {
  23. */
  24. int (*did_interrupt)(struct phy_device *phydev);
  25. + /*
  26. + * Called before an ethernet device is detached
  27. + * from the PHY.
  28. + */
  29. + void (*detach)(struct phy_device *phydev);
  30. +
  31. /* Clears up any memory if needed */
  32. void (*remove)(struct phy_device *phydev);