1
0
Fork 0

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
Bogdan Purcareata 2017-09-28 11:07:33 +00:00 committed by Dong Aisheng
parent cdb4ed7cb9
commit 7038d1de65
1 changed files with 9 additions and 0 deletions

View File

@ -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);