Re: [PATCH v3] dmaengine: moxart: handle irq_of_parse_and_map() errors

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

 



On Sun, Aug 18, 2024, at 09:17, Ma Ke wrote:
> Zero and negative number is not a valid IRQ for in-kernel code and the
> irq_of_parse_and_map() function returns zero on error.  So this check for
> valid IRQs should only accept values > 0.
>
> Cc: stable@xxxxxxxxxxxxxxx
> Fixes: 2d9e31b9412c ("dmaengine: moxart: remove NO_IRQ")
> Signed-off-by: Ma Ke <make24@xxxxxxxxxxx>
> ---

This makes no sense to me, you explain why the current code is
correct and then change it to something wrong?

> diff --git a/drivers/dma/moxart-dma.c b/drivers/dma/moxart-dma.c
> index 66dc6d31b603..16dd3c5aba4d 100644
> --- a/drivers/dma/moxart-dma.c
> +++ b/drivers/dma/moxart-dma.c
> @@ -568,7 +568,7 @@ static int moxart_probe(struct platform_device *pdev)
>  		return -ENOMEM;
> 
>  	irq = irq_of_parse_and_map(node, 0);
> -	if (!irq) {
> +	if (irq <= 0) {
>  		dev_err(dev, "no IRQ resource\n");
>  		return -EINVAL;

The "if (!irq)" is clearly the intended check, as you explain
irq_of_parse_and_map() returns 0 on error.

      Arnd




[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux