Commit 23cc961a authored by Andi Shyti's avatar Andi Shyti

i2c: qcom-geni: Use goto for clearer exit path

Refactor the code by using goto statements to reduce duplication
and make the exit path clearer.
Signed-off-by: default avatarAndi Shyti <andi.shyti@kernel.org>
parent 2d30c638
...@@ -986,21 +986,24 @@ static int __maybe_unused geni_i2c_runtime_resume(struct device *dev) ...@@ -986,21 +986,24 @@ static int __maybe_unused geni_i2c_runtime_resume(struct device *dev)
return ret; return ret;
ret = clk_prepare_enable(gi2c->core_clk); ret = clk_prepare_enable(gi2c->core_clk);
if (ret) { if (ret)
geni_icc_disable(&gi2c->se); goto out_icc_disable;
return ret;
}
ret = geni_se_resources_on(&gi2c->se); ret = geni_se_resources_on(&gi2c->se);
if (ret) { if (ret)
clk_disable_unprepare(gi2c->core_clk); goto out_clk_disable;
geni_icc_disable(&gi2c->se);
return ret;
}
enable_irq(gi2c->irq); enable_irq(gi2c->irq);
gi2c->suspended = 0; gi2c->suspended = 0;
return 0; return 0;
out_clk_disable:
clk_disable_unprepare(gi2c->core_clk);
out_icc_disable:
geni_icc_disable(&gi2c->se);
return ret;
} }
static int __maybe_unused geni_i2c_suspend_noirq(struct device *dev) static int __maybe_unused geni_i2c_suspend_noirq(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