Skip to content

Commit 97fd62e

Browse files
tititiou36Wolfram Sang
authored andcommitted
i2c: wmt: Fix an error handling path in wmt_i2c_probe()
wmt_i2c_reset_hardware() calls clk_prepare_enable(). So, should an error occur after it, it should be undone by a corresponding clk_disable_unprepare() call, as already done in the remove function. Fixes: 560746e ("i2c: vt8500: Add support for I2C bus on Wondermedia SoCs") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
1 parent ceb013b commit 97fd62e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/i2c/busses/i2c-wmt.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,11 +378,15 @@ static int wmt_i2c_probe(struct platform_device *pdev)
378378

379379
err = i2c_add_adapter(adap);
380380
if (err)
381-
return err;
381+
goto err_disable_clk;
382382

383383
platform_set_drvdata(pdev, i2c_dev);
384384

385385
return 0;
386+
387+
err_disable_clk:
388+
clk_disable_unprepare(i2c_dev->clk);
389+
return err;
386390
}
387391

388392
static void wmt_i2c_remove(struct platform_device *pdev)

0 commit comments

Comments
 (0)