net: ethernet: lpc_eth: Handle error for clk_enable

[ Upstream commit 2169b79258 ]

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

Fixes: b7370112f5 ("lpc32xx: Added ethernet driver")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Jiasheng Jiang 2022-03-08 14:57:39 +08:00 коммит произвёл Greg Kroah-Hartman
Родитель c746fa0f54
Коммит 6e294d3890
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -1469,6 +1469,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);
@ -1478,7 +1479,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);