staging:iio:dac:ad5504: Check if IRQ was requested before freeing it
authorLars-Peter Clausen <lars@metafoo.de>
Mon, 4 Jun 2012 09:36:25 +0000 (11:36 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 5 Jun 2012 04:47:32 +0000 (13:47 +0900)
IRQ support is optional, so we have to check whether it was actually requested
before we attempt to free it.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/iio/dac/ad5504.c

index 220150d2a165e31dc351091242213adc5eae22b9..f3d7b47cfe1d1046402f1b385f825638ab66c13e 100644 (file)
@@ -294,7 +294,8 @@ static int __devinit ad5504_probe(struct spi_device *spi)
        return 0;
 
 error_free_irq:
-       free_irq(spi->irq, indio_dev);
+       if (spi->irq)
+               free_irq(spi->irq, indio_dev);
 error_disable_reg:
        if (!IS_ERR(reg))
                regulator_disable(reg);