net: phy: Add missing phy_unregister_device
The counterpart of phy_register_device is missing. Add it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
e8388cbb37
commit
efe0fa9e92
|
@ -272,6 +272,17 @@ int phy_register_device(struct phy_device *phydev)
|
|||
return ret;
|
||||
}
|
||||
|
||||
void phy_unregister_device(struct phy_device *phydev)
|
||||
{
|
||||
if (!phydev->registered)
|
||||
return;
|
||||
|
||||
phydev->bus->phy_map[phydev->addr] = NULL;
|
||||
|
||||
unregister_device(&phydev->dev);
|
||||
phydev->registered = 0;
|
||||
}
|
||||
|
||||
static struct phy_device *of_mdio_find_phy(struct eth_device *edev)
|
||||
{
|
||||
struct device_d *dev;
|
||||
|
|
|
@ -266,6 +266,7 @@ int phy_init(void);
|
|||
int phy_init_hw(struct phy_device *phydev);
|
||||
|
||||
int phy_register_device(struct phy_device* dev);
|
||||
void phy_unregister_device(struct phy_device *phydev);
|
||||
|
||||
/**
|
||||
* phy_read - Convenience function for reading a given PHY register
|
||||
|
|
Loading…
Reference in New Issue