mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
UPSTREAM: 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: Andi Shyti <andi.shyti@kernel.org> Bug: 370629635 Change-Id: I6e7152bd47d76bc7dd0eb98ffd7906eb52b91478 (cherry picked from commit 23cc961a08591976eb17ca8552a602425b1a780d) Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
This commit is contained in:
@@ -985,21 +985,24 @@ static int __maybe_unused geni_i2c_runtime_resume(struct device *dev)
|
||||
return ret;
|
||||
|
||||
ret = clk_prepare_enable(gi2c->core_clk);
|
||||
if (ret) {
|
||||
geni_icc_disable(&gi2c->se);
|
||||
return ret;
|
||||
}
|
||||
if (ret)
|
||||
goto out_icc_disable;
|
||||
|
||||
ret = geni_se_resources_on(&gi2c->se);
|
||||
if (ret) {
|
||||
clk_disable_unprepare(gi2c->core_clk);
|
||||
geni_icc_disable(&gi2c->se);
|
||||
return ret;
|
||||
}
|
||||
if (ret)
|
||||
goto out_clk_disable;
|
||||
|
||||
enable_irq(gi2c->irq);
|
||||
gi2c->suspended = 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)
|
||||
|
||||
Reference in New Issue
Block a user