Commit 42aa38b5 authored by Sowjanya Komatineni's avatar Sowjanya Komatineni Committed by Wolfram Sang

i2c: tegra: Fix the error path in tegra_i2c_runtime_resume

tegra_i2c_runtime_resume does not disable prior enabled clocks
properly.

This patch fixes it.
Reviewed-by: default avatarDmitry Osipenko <digetx@gmail.com>
Signed-off-by: default avatarSowjanya Komatineni <skomatineni@nvidia.com>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
parent 7232f53e
...@@ -665,18 +665,23 @@ static int __maybe_unused tegra_i2c_runtime_resume(struct device *dev) ...@@ -665,18 +665,23 @@ static int __maybe_unused tegra_i2c_runtime_resume(struct device *dev)
ret = clk_enable(i2c_dev->slow_clk); ret = clk_enable(i2c_dev->slow_clk);
if (ret < 0) { if (ret < 0) {
dev_err(dev, "failed to enable slow clock: %d\n", ret); dev_err(dev, "failed to enable slow clock: %d\n", ret);
return ret; goto disable_fast_clk;
} }
ret = clk_enable(i2c_dev->div_clk); ret = clk_enable(i2c_dev->div_clk);
if (ret < 0) { if (ret < 0) {
dev_err(i2c_dev->dev, dev_err(i2c_dev->dev,
"Enabling div clk failed, err %d\n", ret); "Enabling div clk failed, err %d\n", ret);
clk_disable(i2c_dev->fast_clk); goto disable_slow_clk;
return ret;
} }
return 0; return 0;
disable_slow_clk:
clk_disable(i2c_dev->slow_clk);
disable_fast_clk:
clk_disable(i2c_dev->fast_clk);
return ret;
} }
static int __maybe_unused tegra_i2c_runtime_suspend(struct device *dev) static int __maybe_unused tegra_i2c_runtime_suspend(struct device *dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment