mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 05:02:12 +00:00
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: a57f9b4dd6
("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>
This commit is contained in:
parent
32d4536133
commit
5692900bed
@ -520,8 +520,10 @@ static int meson_i2c_probe(struct platform_device *pdev)
|
||||
meson_i2c_set_mask(i2c, REG_SLAVE_ADDR,
|
||||
REG_SLV_SDA_FILTER_MASK | REG_SLV_SCL_FILTER_MASK, 0);
|
||||
|
||||
if (!i2c->data->set_clk_div)
|
||||
if (!i2c->data->set_clk_div) {
|
||||
clk_disable_unprepare(i2c->clk);
|
||||
return -EINVAL;
|
||||
}
|
||||
i2c->data->set_clk_div(i2c, timings.bus_freq_hz);
|
||||
|
||||
ret = i2c_add_adapter(&i2c->adap);
|
||||
|
Loading…
Reference in New Issue
Block a user