iio: adc: vf610: Propagate the real error when platform_get_irq() fails
authorFabio Estevam <fabio.estevam@freescale.com>
Fri, 3 Oct 2014 01:25:22 +0000 (22:25 -0300)
committerJonathan Cameron <jic23@kernel.org>
Wed, 22 Oct 2014 19:28:11 +0000 (20:28 +0100)
There is no need to pass a 'fake' return value when platform_get_irq() fails.

Propagate the real error instead.

While at it, only consider negative numbers returned by platform_get_irq()
as error.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/adc/vf610_adc.c

index d47fff003b78dbdb90d39c800949b34b7a42c3f2..8ec353c01d98e02e7074df9d4d295ec19f772f09 100644 (file)
@@ -593,9 +593,9 @@ static int vf610_adc_probe(struct platform_device *pdev)
                return PTR_ERR(info->regs);
 
        irq = platform_get_irq(pdev, 0);
-       if (irq <= 0) {
+       if (irq < 0) {
                dev_err(&pdev->dev, "no irq resource?\n");
-               return -EINVAL;
+               return irq;
        }
 
        ret = devm_request_irq(info->dev, irq,