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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> ---
> 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 [李琼斯]



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux