Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Sowjanya Komatineni and committed by
Wolfram Sang
42aa38b5 7232f53e

+8 -3
+8 -3
drivers/i2c/busses/i2c-tegra.c
··· 665 665 ret = clk_enable(i2c_dev->slow_clk); 666 666 if (ret < 0) { 667 667 dev_err(dev, "failed to enable slow clock: %d\n", ret); 668 - return ret; 668 + goto disable_fast_clk; 669 669 } 670 670 671 671 ret = clk_enable(i2c_dev->div_clk); 672 672 if (ret < 0) { 673 673 dev_err(i2c_dev->dev, 674 674 "Enabling div clk failed, err %d\n", ret); 675 - clk_disable(i2c_dev->fast_clk); 676 - return ret; 675 + goto disable_slow_clk; 677 676 } 678 677 679 678 return 0; 679 + 680 + disable_slow_clk: 681 + clk_disable(i2c_dev->slow_clk); 682 + disable_fast_clk: 683 + clk_disable(i2c_dev->fast_clk); 684 + return ret; 680 685 } 681 686 682 687 static int __maybe_unused tegra_i2c_runtime_suspend(struct device *dev)