i2c: lpc2k: Add check for clk_enable()
Add check for the return value of clk_enable() to catch
the potential error.
This is similar to the commit 8332e66709
("spi: zynq-qspi: Add check for clk_enable()").
Signed-off-by: Chenyuan Yang <chenyuan0y@gmail.com>
Link: https://lore.kernel.org/r/20250412193713.105838-1-chenyuan0y@gmail.com
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
pull/1253/head
parent
5a1934f1c2
commit
b7a886e7e9
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue