]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: ethernet: lpc_eth: Handle error for clk_enable
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Tue, 8 Mar 2022 06:57:39 +0000 (14:57 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Mar 2022 12:15:20 +0000 (12:15 +0000)
As the potential failure of the clk_enable(),
it should be better to check it and return error
if fails.

Fixes: 716dd1fe35e7 ("lpc32xx: Added ethernet driver")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/nxp/lpc_eth.c

index bc39558fe82be1e6e38e1a38b0c22b2f8ee50305..756f97dce85b2b4a5ed95667adeffe177b7b0984 100644 (file)
@@ -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);