* [PATCH] net: ethernet: lpc_eth: Handle error for clk_enable
@ 2022-03-08 6:57 Jiasheng Jiang
2022-03-09 12:20 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Jiasheng Jiang @ 2022-03-08 6:57 UTC (permalink / raw)
To: vz, davem, kuba; +Cc: linux-arm-kernel, netdev, linux-kernel, Jiasheng Jiang
As the potential failure of the clk_enable(),
it should be better to check it and return error
if fails.
Fixes: b7370112f519 ("lpc32xx: Added ethernet driver")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
---
drivers/net/ethernet/nxp/lpc_eth.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c
index bc39558fe82b..756f97dce85b 100644
--- a/drivers/net/ethernet/nxp/lpc_eth.c
+++ b/drivers/net/ethernet/nxp/lpc_eth.c
@@ -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);
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: ethernet: lpc_eth: Handle error for clk_enable
2022-03-08 6:57 [PATCH] net: ethernet: lpc_eth: Handle error for clk_enable Jiasheng Jiang
@ 2022-03-09 12:20 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-03-09 12:20 UTC (permalink / raw)
To: Jiasheng Jiang; +Cc: vz, davem, kuba, linux-arm-kernel, netdev, linux-kernel
Hello:
This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:
On Tue, 8 Mar 2022 14:57:39 +0800 you wrote:
> As the potential failure of the clk_enable(),
> it should be better to check it and return error
> if fails.
>
> Fixes: b7370112f519 ("lpc32xx: Added ethernet driver")
> Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
>
> [...]
Here is the summary with links:
- net: ethernet: lpc_eth: Handle error for clk_enable
https://git.kernel.org/netdev/net/c/2169b79258c8
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-03-09 12:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-08 6:57 [PATCH] net: ethernet: lpc_eth: Handle error for clk_enable Jiasheng Jiang
2022-03-09 12:20 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).