Skip to content
Snippets Groups Projects
Commit ea9092af authored by Gabor Juhos's avatar Gabor Juhos Committed by Kenneth Johansson
Browse files

generic: add detach callback to struct phy_driver


lede-commit: fe61fc2d7d0b3fb348b502f68f98243b3ddf5867

Signed-off-by: default avatarGabor Juhos <juhosg@openwrt.org>
parent 9806925d
Branches
No related tags found
No related merge requests found
...@@ -1001,6 +1001,9 @@ void phy_detach(struct phy_device *phydev) ...@@ -1001,6 +1001,9 @@ void phy_detach(struct phy_device *phydev)
struct mii_bus *bus; struct mii_bus *bus;
int i; int i;
if (phydev->drv && phydev->drv->detach)
phydev->drv->detach(phydev);
phydev->attached_dev->phydev = NULL; phydev->attached_dev->phydev = NULL;
phydev->attached_dev = NULL; phydev->attached_dev = NULL;
phy_suspend(phydev); phy_suspend(phydev);
......
...@@ -507,6 +507,12 @@ struct phy_driver { ...@@ -507,6 +507,12 @@ struct phy_driver {
*/ */
int (*did_interrupt)(struct phy_device *phydev); int (*did_interrupt)(struct phy_device *phydev);
/*
* Called before an ethernet device is detached
* from the PHY.
*/
void (*detach)(struct phy_device *phydev);
/* Clears up any memory if needed */ /* Clears up any memory if needed */
void (*remove)(struct phy_device *phydev); void (*remove)(struct phy_device *phydev);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment