diff options
author | Yang Yingliang <yangyingliang@huawei.com> | 2022-04-21 12:00:42 +0300 |
---|---|---|
committer | Wolfram Sang <wsa@kernel.org> | 2022-05-04 23:37:52 +0300 |
commit | 5692900bed2a76c4086dc25557f28d7baac9307c (patch) | |
tree | 25d80815e336cbe83f5aac2b9c213b761fb5a8f1 /drivers/i2c/busses/i2c-meson.c | |
parent | 32d4536133f5d96b0b63ff70748b9ef4579b211d (diff) | |
download | linux-5692900bed2a76c4086dc25557f28d7baac9307c.tar.xz |
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: a57f9b4dd6f5 ("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>
Diffstat (limited to 'drivers/i2c/busses/i2c-meson.c')
-rw-r--r-- | drivers/i2c/busses/i2c-meson.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-meson.c b/drivers/i2c/busses/i2c-meson.c index 50dab123380a..195a9716da31 100644 --- a/drivers/i2c/busses/i2c-meson.c +++ b/drivers/i2c/busses/i2c-meson.c @@ -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); |