linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging:iio:dac:ad5504: Check if IRQ was requested before freeing it
@ 2012-05-15  7:51 Lars-Peter Clausen
  2012-05-15  7:53 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Lars-Peter Clausen @ 2012-05-15  7:51 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio, Lars-Peter Clausen

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>
---
 drivers/staging/iio/dac/ad5504.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/iio/dac/ad5504.c b/drivers/staging/iio/dac/ad5504.c
index 6ccf178..cd754d2 100644
--- a/drivers/staging/iio/dac/ad5504.c
+++ b/drivers/staging/iio/dac/ad5504.c
@@ -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);
-- 
1.7.10

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging:iio:dac:ad5504: Check if IRQ was requested before freeing it
  2012-05-15  7:51 [PATCH] staging:iio:dac:ad5504: Check if IRQ was requested before freeing it Lars-Peter Clausen
@ 2012-05-15  7:53 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2012-05-15  7:53 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: linux-iio

On 5/15/2012 8:51 AM, Lars-Peter Clausen wrote:
> IRQ support is optional, so we have to check whether it was actually requested
> before we attempt to free it.
good spot.
>
> Signed-off-by: Lars-Peter Clausen<lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
> ---
>   drivers/staging/iio/dac/ad5504.c |    3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/iio/dac/ad5504.c b/drivers/staging/iio/dac/ad5504.c
> index 6ccf178..cd754d2 100644
> --- a/drivers/staging/iio/dac/ad5504.c
> +++ b/drivers/staging/iio/dac/ad5504.c
> @@ -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);


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-05-15  7:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-15  7:51 [PATCH] staging:iio:dac:ad5504: Check if IRQ was requested before freeing it Lars-Peter Clausen
2012-05-15  7:53 ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).