staging: fsl-dpaa2/mac: Free phydev on unbind
Stop polling and unregister / disconnect the phydev structure on DPAA2 mac driver unbind. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>5.4-rM2-2.2.x-imx-squashed
parent
cdb4ed7cb9
commit
7038d1de65
|
@ -623,6 +623,15 @@ static int dpaa2_mac_remove(struct fsl_mc_device *mc_dev)
|
|||
{
|
||||
struct device *dev = &mc_dev->dev;
|
||||
struct dpaa2_mac_priv *priv = dev_get_drvdata(dev);
|
||||
struct net_device *netdev = priv->netdev;
|
||||
|
||||
dpaa2_mac_stop(netdev);
|
||||
|
||||
if (phy_is_pseudo_fixed_link(netdev->phydev))
|
||||
fixed_phy_unregister(netdev->phydev);
|
||||
else
|
||||
phy_disconnect(netdev->phydev);
|
||||
netdev->phydev = NULL;
|
||||
|
||||
#ifdef CONFIG_FSL_DPAA2_MAC_NETDEVS
|
||||
unregister_netdev(priv->netdev);
|
||||
|
|
Loading…
Reference in New Issue