of_mdio: add helper to deregister fixed-link PHYs
Add helper to deregister fixed-link PHYs registered using of_phy_register_fixed_link(). Convert the two drivers that care to deregister their fixed-link PHYs to use the new helper, but note that most drivers currently fail to do so. Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committato da
David S. Miller

parent
0d8f3c6715
commit
3f65047c85
@@ -490,3 +490,18 @@ int of_phy_register_fixed_link(struct device_node *np)
|
||||
return -ENODEV;
|
||||
}
|
||||
EXPORT_SYMBOL(of_phy_register_fixed_link);
|
||||
|
||||
void of_phy_deregister_fixed_link(struct device_node *np)
|
||||
{
|
||||
struct phy_device *phydev;
|
||||
|
||||
phydev = of_phy_find_device(np);
|
||||
if (!phydev)
|
||||
return;
|
||||
|
||||
fixed_phy_unregister(phydev);
|
||||
|
||||
put_device(&phydev->mdio.dev); /* of_phy_find_device() */
|
||||
phy_device_free(phydev); /* fixed_phy_register() */
|
||||
}
|
||||
EXPORT_SYMBOL(of_phy_deregister_fixed_link);
|
||||
|
Fai riferimento in un nuovo problema
Block a user