Commit 2169b792 authored by 蒋家盛's avatar 蒋家盛 Committed by David S. Miller
Browse files

net: ethernet: lpc_eth: Handle error for clk_enable



As the potential failure of the clk_enable(),
it should be better to check it and return error
if fails.

Fixes: b7370112 ("lpc32xx: Added ethernet driver")
Signed-off-by: default avatarJiasheng Jiang <jiasheng@iscas.ac.cn>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2a760554
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1471,6 +1471,7 @@ static int lpc_eth_drv_resume(struct platform_device *pdev)
{
	struct net_device *ndev = platform_get_drvdata(pdev);
	struct netdata_local *pldat;
	int ret;

	if (device_may_wakeup(&pdev->dev))
		disable_irq_wake(ndev->irq);
@@ -1480,7 +1481,9 @@ static int lpc_eth_drv_resume(struct platform_device *pdev)
			pldat = netdev_priv(ndev);

			/* Enable interface clock */
			clk_enable(pldat->clk);
			ret = clk_enable(pldat->clk);
			if (ret)
				return ret;

			/* Reset and initialize */
			__lpc_eth_reset(pldat);