Skip to content

Commit 5692900

Browse files
Yang Yingliangwsakernel
authored andcommitted
i2c: meson: fix missing clk_disable_unprepare() on error in meson_i2c_probe()
Fix the missing clk_disable_unprepare() before return from meson_i2c_probe() in the error handling case. Fixes: a57f9b4 ("i2c: meson: Use 50% duty cycle for I2C clock") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Wolfram Sang <wsa@kernel.org>
1 parent 32d4536 commit 5692900

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/i2c/busses/i2c-meson.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,8 +520,10 @@ static int meson_i2c_probe(struct platform_device *pdev)
520520
meson_i2c_set_mask(i2c, REG_SLAVE_ADDR,
521521
REG_SLV_SDA_FILTER_MASK | REG_SLV_SCL_FILTER_MASK, 0);
522522

523-
if (!i2c->data->set_clk_div)
523+
if (!i2c->data->set_clk_div) {
524+
clk_disable_unprepare(i2c->clk);
524525
return -EINVAL;
526+
}
525527
i2c->data->set_clk_div(i2c, timings.bus_freq_hz);
526528

527529
ret = i2c_add_adapter(&i2c->adap);

0 commit comments

Comments
 (0)