Re: [PATCH] mfd: fsl-imx25: Fix an error handling path in mx25_tsadc_setup_irq()
From: Lee Jones <lee@kernel.org>
Date: 2022-08-10 11:14:38
Also in:
kernel-janitors, lkml
From: Lee Jones <lee@kernel.org>
Date: 2022-08-10 11:14:38
Also in:
kernel-janitors, lkml
On Sun, 31 Jul 2022, Christophe JAILLET wrote:
If devm_of_platform_populate() fails, some resources need to be
released.
Introduce a mx25_tsadc_unset_irq() function that undoes
mx25_tsadc_setup_irq() and call it both from the new error handling path
of the probe and in the remove function.
Fixes: a55196eff6d6 ("mfd: fsl-imx25: Use devm_of_platform_populate()")
Signed-off-by: Christophe JAILLET <redacted>
---
mx25_tsadc_setup_irq() and mx25_tsadc_unset_irq() are not symetrical.
One tests for "(irq <= 0)" while the other one tests for "(irq)".
If <0 the probe will fails, so that is fine.
If ==0, according to doc platform_get_irq() can't return 0, so that should
be fine as well.
That said, I think that the "if (irq)" in mx25_tsadc_unset_irq() can be
removed.
---
drivers/mfd/fsl-imx25-tsadc.c | 32 ++++++++++++++++++++++++--------
1 file changed, 24 insertions(+), 8 deletions(-)Applied, thanks. -- Lee Jones [李琼斯] _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel