[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241105161820.32512-1-jiashengjiangcool@gmail.com>
Date: Tue, 5 Nov 2024 16:18:18 +0000
From: Jiasheng Jiang <jiashengjiangcool@...il.com>
To: andi.shyti@...nel.org
Cc: rmk@...-67.arm.linux.org.uk,
max.schwarz@...ine.de,
dianders@...omium.org,
david.wu@...k-chips.com,
heiko@...ech.de,
vz@...ia.com,
wsa@...nel.org,
manabian@...il.com,
linux-arm-kernel@...ts.infradead.org,
linux-rockchip@...ts.infradead.org,
linux-i2c@...r.kernel.org,
linux-kernel@...r.kernel.org,
Jiasheng Jiang <jiashengjiangcool@...il.com>
Subject: [PATCH v2 1/3] i2c: lpc2k: Add check for clk_enable()
Add check for the return value of clk_enable() in order to catch the
potential exception.
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@...il.com>
---
Changelog:
v1 -> v2:
1. Remove the Fixes tag.
2. Use dev_err_probe to simplify error handling.
---
drivers/i2c/busses/i2c-lpc2k.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-lpc2k.c b/drivers/i2c/busses/i2c-lpc2k.c
index 9fb33cbf7419..0fe7d4421a31 100644
--- a/drivers/i2c/busses/i2c-lpc2k.c
+++ b/drivers/i2c/busses/i2c-lpc2k.c
@@ -442,8 +442,12 @@ 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;
+
+ ret = clk_enable(i2c->clk);
+ if (ret)
+ return dev_err_probe(dev, ret, "failed to enable clock: %d\n", ret);
- clk_enable(i2c->clk);
i2c_lpc2k_reset(i2c);
return 0;
--
2.25.1
Powered by blists - more mailing lists