mbox series

[0/4] mfd: exynos-lpass: Fix some error handling paths

Message ID cover.1743231856.git.christophe.jaillet@wanadoo.fr
Headers show
Series mfd: exynos-lpass: Fix some error handling paths | expand

Message

Christophe JAILLET March 29, 2025, 7:45 a.m. UTC
This serie fixes several issues related to error handling paths in
drivers/mfd/exynos-lpass.c.

I've split it in 4 patches to ease review, but could be merge in only
1 patch. Or only (3 and 4) could be merged, as they are related.

Patch 1: Fix a leak in the error handling path of the probe. It Should
be straighforward.

Patch 2: Slighly unsure of the order of the code. In the probe, we
enable pm, then lpass, so should we disable lpass, then pm?

Patch 3: Is just a preparation for patch 4. It makes patch 4 more
readable.

Patch 4: Fix a leak in the error handling path of the probe. It Should
be straighforward.


All these patches are compile tested only.

Christophe JAILLET (4):
  mfd: exynos-lpass: Fix an error handling path in exynos_lpass_probe()
  mfd: exynos-lpass: Avoid calling exynos_lpass_disable() twice in
    exynos_lpass_remove()
  mfd: exynos-lpass: Move exynos_lpass_remove()
  mfd: exynos-lpass: Fix another error handling path in
    exynos_lpass_probe()

 drivers/mfd/exynos-lpass.c | 31 +++++++++++++++++++------------
 1 file changed, 19 insertions(+), 12 deletions(-)

Comments

Krzysztof Kozlowski March 30, 2025, 10:01 a.m. UTC | #1
On 29/03/2025 08:45, Christophe JAILLET wrote:
> If an error occurs after a successful regmap_init_mmio(), regmap_exit()
> should be called as already done in the .remove() function.
> 
> Switch to devm_regmap_init_mmio() to avoid the leak and simplify the
> .remove() function.
> 
> Fixes: c695abab2429 ("mfd: Add Samsung Exynos Low Power Audio Subsystem driver")

c414df12bdf7 should be fixed instead, I think.

> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> The .remove function was added in commit c414df12bdf7 ("mfd: exynos-lpass:
> Add missing remove() function")

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof
Krzysztof Kozlowski March 30, 2025, 10:02 a.m. UTC | #2
On 29/03/2025 08:45, Christophe JAILLET wrote:
> In order be able to call exynos_lpass_remove() from the error handling
> path of the probe, it first needs to be moved before the probe.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---

This change makes no sense on its own. There is no point in moving the
code just for moving the code. That's not the goal.

Squash it.

Best regards,
Krzysztof