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

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
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -2317,6 +2317,14 @@ static int ravb_close(struct net_device *ndev)
	ravb_write(ndev, 0, RIC2);
	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 */
	if (info->gptp || info->ccc_gac)
		ravb_ptp_stop(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);

	if (info->nc_queues)