Add missing icc_disable in exit path
Subsystems (4)
Andi Shyti
maintainercover Add missing icc_disable in exit path
Hi,
Last week I committed the following patches from Gaosheng:
9ba48db9f77ce i2c: qcom-geni: Add missing geni_icc_disable in geni_i2c_runtime_resume b93d16bee5573 i2c: qcom-geni: Add missing clk_disable_unprepare in geni_i2c_runtime_resume
that wanted to add some cleanups in the geni_i2c_runtime_resume() exit path. However, one case was overlooked. While addressing this, I also replaced multiple return statements with a single goto exit to improve code clarity and consistency.
I decided to keep the patches separate because the first patch applies cleanly to the stable branch, whereas merging them into a single patch would have created complications for backporting.
Thanks,
Andi
Andi Shyti (2):
i2c: qcom-geni: Add missing geni_icc_disable in geni_i2c_runtime_resume
i2c: qcom-geni: Use goto for clearer exit path
drivers/i2c/busses/i2c-qcom-geni.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-)
Signature · 1 line
2.45.2
Andi Shyti
maintainerPATCH 1/2 i2c: qcom-geni: Add missing geni_icc_disable in geni_i2c_runtime_resume
Add the missing geni_icc_disable() call before returning in the geni_i2c_runtime_resume() function.
Commit 9ba48db9f77c ("i2c: qcom-geni: Add missing geni_icc_disable in geni_i2c_runtime_resume") by Gaosheng missed disabling the interconnect in one case.
---
Cc: Bjorn Andersson <[email protected]>
Cc: Konrad Dybcio <[email protected]>
Cc: Vladimir Zapolskiy <[email protected]>
drivers/i2c/busses/i2c-qcom-geni.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/i2c/busses/i2c-qcom-geni.c +3 -1
@@ -986,8 +986,10 @@ static int __maybe_unused geni_i2c_runtime_resume(struct device *dev)return ret; ret =clk_prepare_enable (gi2c->core_clk); -if (ret) +if (ret) { +geni_icc_disable (&gi2c->se);return ret; + } ret =geni_se_resources_on (&gi2c->se);if (ret) {
Signature · 1 line
2.45.2
Andi Shyti
maintainerPATCH 2/2 i2c: qcom-geni: Use goto for clearer exit path
In reply to Andi ShytiRefactor the code by using goto statements to reduce duplication and make the exit path clearer.
---
Cc: Bjorn Andersson <[email protected]>
Cc: Gaosheng Cui <[email protected]>
Cc: Konrad Dybcio <[email protected]>
Cc: Vladimir Zapolskiy <[email protected]>
drivers/i2c/busses/i2c-qcom-geni.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-)
drivers/i2c/busses/i2c-qcom-geni.c +12 -9
@@ -986,21 +986,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)
Signature · 1 line
2.45.2
Re: [PATCH 2/2] i2c: qcom-geni: Use goto for clearer exit path
Quoted 4 lines · Andi Shyti
Refactor the code by using goto statements to reduce duplication and make the exit path clearer.
Signed-off-by Andi Shyti <[email protected]>
merged to i2c/i2c-host.
Andi
Andi Shyti
maintainerHi,
Quoted 2 lines
Andi Shyti (2):
i2c: qcom-geni: Add missinggeni_icc_disableingeni_i2c_runtime_resume
Because this was a fix I merged it...
Quoted 1 line
i2c: qcom-geni: Use goto for clearer exit path
... I leave this one for more comment opportunities.
Andi