Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c66f6c37 authored by Thierry Reding's avatar Thierry Reding Committed by David S. Miller
Browse files

net: stmmac: Disable PTP reference clock on error



If an error occurs while opening the device, make sure to disable the
PTP reference clock.

Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6c1e5abe
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1754,6 +1754,13 @@ static int stmmac_hw_setup(struct net_device *dev, bool init_ptp)
	return 0;
}

static void stmmac_hw_teardown(struct net_device *dev)
{
	struct stmmac_priv *priv = netdev_priv(dev);

	clk_disable_unprepare(priv->plat->clk_ptp_ref);
}

/**
 *  stmmac_open - open entry point of the driver
 *  @dev : pointer to the device structure.
@@ -1863,6 +1870,7 @@ static int stmmac_open(struct net_device *dev)
		phy_stop(dev->phydev);

	del_timer_sync(&priv->txtimer);
	stmmac_hw_teardown(dev);
init_error:
	free_dma_desc_resources(priv);
dma_desc_error: