Re: [PATCH] media: stm32-dcmi: fix irq = 0 case

From: Hans Verkuil
Date: Mon Jun 03 2019 - 07:49:20 EST


On 5/31/19 11:18 AM, Fabien Dessenne wrote:
> Manage the irq = 0 case, where we shall return an error.
>
> Fixes: b5b5a27bee58 ("media: stm32-dcmi: return appropriate error codes during probe")
> Signed-off-by: Fabien Dessenne <fabien.dessenne@xxxxxx>
> ---
> drivers/media/platform/stm32/stm32-dcmi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c
> index b9dad0a..d855e9c 100644
> --- a/drivers/media/platform/stm32/stm32-dcmi.c
> +++ b/drivers/media/platform/stm32/stm32-dcmi.c
> @@ -1702,7 +1702,7 @@ static int dcmi_probe(struct platform_device *pdev)
> if (irq <= 0) {

Shouldn't this be 'irq < 0' instead of '<=' ?

AFAICT irq == 0 can be a valid irq and isn't an error.

Regards,

Hans

> if (irq != -EPROBE_DEFER)
> dev_err(&pdev->dev, "Could not get irq\n");
> - return irq;
> + return irq ? irq : -ENXIO;
> }
>
> dcmi->res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>