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: 560746eb79 ("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>
This commit is contained in:
Christophe JAILLET 2024-01-05 15:39:35 +01:00 committed by Wolfram Sang
parent ceb013b2d9
commit 97fd62e326
1 changed files with 5 additions and 1 deletions

View File

@ -378,11 +378,15 @@ static int wmt_i2c_probe(struct platform_device *pdev)
err = i2c_add_adapter(adap);
if (err)
return err;
goto err_disable_clk;
platform_set_drvdata(pdev, i2c_dev);
return 0;
err_disable_clk:
clk_disable_unprepare(i2c_dev->clk);
return err;
}
static void wmt_i2c_remove(struct platform_device *pdev)