summaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-tegra.c
diff options
context:
space:
mode:
authorSowjanya Komatineni <skomatineni@nvidia.com>2020-07-27 22:57:21 +0200
committerWolfram Sang <wsa@kernel.org>2020-07-28 18:32:09 +0200
commit42aa38b54e35216351e52bb03382a38edc6f1bb8 (patch)
treeebea7520468dda68c8572169b691463f4d171595 /drivers/i2c/busses/i2c-tegra.c
parenti2c: tegra: Remove NULL pointer check before clk_enable/disable/prepare/unpre... (diff)
downloadlinux-42aa38b54e35216351e52bb03382a38edc6f1bb8.tar.xz
linux-42aa38b54e35216351e52bb03382a38edc6f1bb8.zip
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: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com> Signed-off-by: Wolfram Sang <wsa@kernel.org>
Diffstat (limited to 'drivers/i2c/busses/i2c-tegra.c')
-rw-r--r--drivers/i2c/busses/i2c-tegra.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
index c91307b9e13d..7b93c454b4c7 100644
--- a/drivers/i2c/busses/i2c-tegra.c
+++ b/drivers/i2c/busses/i2c-tegra.c
@@ -665,18 +665,23 @@ static int __maybe_unused tegra_i2c_runtime_resume(struct device *dev)
ret = clk_enable(i2c_dev->slow_clk);
if (ret < 0) {
dev_err(dev, "failed to enable slow clock: %d\n", ret);
- return ret;
+ goto disable_fast_clk;
}
ret = clk_enable(i2c_dev->div_clk);
if (ret < 0) {
dev_err(i2c_dev->dev,
"Enabling div clk failed, err %d\n", ret);
- clk_disable(i2c_dev->fast_clk);
- return ret;
+ goto disable_slow_clk;
}
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)