* [PATCH] i2c: lpc2k: Add check for clk_enable()
@ 2025-04-12 19:37 Chenyuan Yang
2025-04-13 22:15 ` Andi Shyti
0 siblings, 1 reply; 2+ messages in thread
From: Chenyuan Yang @ 2025-04-12 19:37 UTC (permalink / raw)
To: vz, andi.shyti, wsa, manabian
Cc: linux-arm-kernel, linux-i2c, linux-kernel, Chenyuan Yang
Add check for the return value of clk_enable() to catch
the potential error.
This is similar to the commit 8332e6670997
("spi: zynq-qspi: Add check for clk_enable()").
Signed-off-by: Chenyuan Yang <chenyuan0y@gmail.com>
Fixes: 3f9c37a0c9a5 ("i2c: lpc2k: add driver")
---
drivers/i2c/busses/i2c-lpc2k.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-lpc2k.c b/drivers/i2c/busses/i2c-lpc2k.c
index 6943a0de860a..ccd13c4fb83e 100644
--- a/drivers/i2c/busses/i2c-lpc2k.c
+++ b/drivers/i2c/busses/i2c-lpc2k.c
@@ -442,8 +442,13 @@ static int i2c_lpc2k_suspend(struct device *dev)
static int i2c_lpc2k_resume(struct device *dev)
{
struct lpc2k_i2c *i2c = dev_get_drvdata(dev);
+ int ret;
- clk_enable(i2c->clk);
+ ret = clk_enable(i2c->clk);
+ if (ret) {
+ dev_err(dev, "failed to enable clock.\n");
+ return ret;
+ }
i2c_lpc2k_reset(i2c);
return 0;
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] i2c: lpc2k: Add check for clk_enable()
2025-04-12 19:37 [PATCH] i2c: lpc2k: Add check for clk_enable() Chenyuan Yang
@ 2025-04-13 22:15 ` Andi Shyti
0 siblings, 0 replies; 2+ messages in thread
From: Andi Shyti @ 2025-04-13 22:15 UTC (permalink / raw)
To: Chenyuan Yang
Cc: vz, wsa, manabian, linux-arm-kernel, linux-i2c, linux-kernel
Hi Chenyuan,
On Sat, Apr 12, 2025 at 02:37:13PM -0500, Chenyuan Yang wrote:
> Add check for the return value of clk_enable() to catch
> the potential error.
>
> This is similar to the commit 8332e6670997
> ("spi: zynq-qspi: Add check for clk_enable()").
>
> Signed-off-by: Chenyuan Yang <chenyuan0y@gmail.com>
> Fixes: 3f9c37a0c9a5 ("i2c: lpc2k: add driver")
I removed the Fixes tag, I think it's a bit of an overkill.
Merged into i2c/i2c-host.
Thanks,
Andi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-04-13 22:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-12 19:37 [PATCH] i2c: lpc2k: Add check for clk_enable() Chenyuan Yang
2025-04-13 22:15 ` Andi Shyti
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).