mbox series

[v3,0/2] Qcom Geni exit path cleanups

Message ID 20241227223230.462395-1-andi.shyti@kernel.org
Headers show
Series Qcom Geni exit path cleanups | expand

Message

Andi Shyti Dec. 27, 2024, 10:32 p.m. UTC
Hi,

I am submitting two trivial cleanups in this series. The first
replaces all instances of dev_err with dev_err_probe throughout
the probe function for consistency. The second improves the error
exit path by introducing a single 'goto' label for better
maintainability.

Thank you Mukesh and Vladimir for your reviews.

Thank you,
Andi

Changelog:
----------
v2 -> v3:
 - Don't forget to assign ret the proper value.
 - Add tags in patch 1.
v1 -> v2:
 - Updated the final return statement to return 'ret' instead of
   '0' for consistency. Since 'ret' already holds the value '0',
   this change is purely aesthetic.
 - Renamed the exit label from 'err_off' to 'err_resources' for
   improved clarity and alignment with its purpose.

Andi Shyti (2):
  i2c: qcom-geni: Use dev_err_probe in the probe function
  i2c: qcom-geni: Simplify error handling in probe function

 drivers/i2c/busses/i2c-qcom-geni.c | 56 ++++++++++++++----------------
 1 file changed, 27 insertions(+), 29 deletions(-)

Comments

Vladimir Zapolskiy Dec. 28, 2024, 10:13 p.m. UTC | #1
On 12/28/24 00:32, Andi Shyti wrote:
> Avoid repeating the error handling pattern:
> 
>          geni_se_resources_off(&gi2c->se);
>          clk_disable_unprepare(gi2c->core_clk);
>          return;
> 
> Introduce a single 'goto' exit label for cleanup in case of
> errors. While there are currently two distinct exit points, there
> is no overlap in their handling, allowing both branches to
> coexist cleanly.
> 
> Signed-off-by: Andi Shyti <andi.shyti@kernel.org>

Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>

--
Best wishes,
Vladimir