Skip to content

Commit

Permalink
net: ethernet: lpc_eth: Handle error for clk_enable
Browse files Browse the repository at this point in the history
As the potential failure of the clk_enable(),
it should be better to check it and return error
if fails.

Fixes: b737011 ("lpc32xx: Added ethernet driver")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
JiangJias authored and davem330 committed Mar 9, 2022
1 parent 2a76055 commit 2169b79
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/net/ethernet/nxp/lpc_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 2169b79

Please sign in to comment.