Commit a5f149a9 authored by Claudiu Beznea's avatar Claudiu Beznea Committed by David S. Miller

net: ravb: Keep the reverse order of operations in ravb_close()

Keep the reverse order of operations in ravb_close() when compared with
ravb_open(). This is the recommended configuration sequence.
Signed-off-by: default avatarClaudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: default avatarSergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a260f080
...@@ -2317,6 +2317,14 @@ static int ravb_close(struct net_device *ndev) ...@@ -2317,6 +2317,14 @@ static int ravb_close(struct net_device *ndev)
ravb_write(ndev, 0, RIC2); ravb_write(ndev, 0, RIC2);
ravb_write(ndev, 0, TIC); ravb_write(ndev, 0, TIC);
/* PHY disconnect */
if (ndev->phydev) {
phy_stop(ndev->phydev);
phy_disconnect(ndev->phydev);
if (of_phy_is_fixed_link(np))
of_phy_deregister_fixed_link(np);
}
/* Stop PTP Clock driver */ /* Stop PTP Clock driver */
if (info->gptp || info->ccc_gac) if (info->gptp || info->ccc_gac)
ravb_ptp_stop(ndev); ravb_ptp_stop(ndev);
...@@ -2335,14 +2343,6 @@ static int ravb_close(struct net_device *ndev) ...@@ -2335,14 +2343,6 @@ static int ravb_close(struct net_device *ndev)
} }
} }
/* PHY disconnect */
if (ndev->phydev) {
phy_stop(ndev->phydev);
phy_disconnect(ndev->phydev);
if (of_phy_is_fixed_link(np))
of_phy_deregister_fixed_link(np);
}
cancel_work_sync(&priv->work); cancel_work_sync(&priv->work);
if (info->nc_queues) if (info->nc_queues)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment