2022-03-08 18:22:12

by Jiasheng Jiang

[permalink] [raw]
Subject: [PATCH] net: ethernet: ti: cpts: 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: 8a2c9a5ab4b9 ("net: ethernet: ti: cpts: rework initialization/deinitialization")
Signed-off-by: Jiasheng Jiang <[email protected]>
---
drivers/net/ethernet/ti/cpts.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/ti/cpts.c b/drivers/net/ethernet/ti/cpts.c
index dc70a6bfaa6a..92ca739fac01 100644
--- a/drivers/net/ethernet/ti/cpts.c
+++ b/drivers/net/ethernet/ti/cpts.c
@@ -568,7 +568,9 @@ int cpts_register(struct cpts *cpts)
for (i = 0; i < CPTS_MAX_EVENTS; i++)
list_add(&cpts->pool_data[i].list, &cpts->pool);

- clk_enable(cpts->refclk);
+ err = clk_enable(cpts->refclk);
+ if (err)
+ return err;

cpts_write32(cpts, CPTS_EN, control);
cpts_write32(cpts, TS_PEND_EN, int_enable);
--
2.25.1


2022-03-09 16:23:59

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [PATCH] net: ethernet: ti: cpts: Handle error for clk_enable

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <[email protected]>:

On Tue, 8 Mar 2022 14:40:07 +0800 you wrote:
> As the potential failure of the clk_enable(),
> it should be better to check it and return error
> if fails.
>
> Fixes: 8a2c9a5ab4b9 ("net: ethernet: ti: cpts: rework initialization/deinitialization")
> Signed-off-by: Jiasheng Jiang <[email protected]>
>
> [...]

Here is the summary with links:
- net: ethernet: ti: cpts: Handle error for clk_enable
https://git.kernel.org/netdev/net/c/6babfc6e6fab

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html