[PATCH] mfd: fsl-imx25: Fix an error handling path in mx25_tsadc_setup_irq()

Lee Jones lee at kernel.org
Wed Aug 10 04:14:26 PDT 2022


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 <christophe.jaillet at wanadoo.fr>
> ---
> 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 [李琼斯]



More information about the linux-arm-kernel mailing list