Commit 487db485 authored by Jonathan Cameron's avatar Jonathan Cameron Committed by Greg Kroah-Hartman

staging:iio: use spi->irq valid rather than querying available modes

Given these drivers only try to add the trigger if a valid
irq is present it is clearer to check the same condition when
deciding whether to remove it on a later trigger.
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8b1f5227
...@@ -1172,7 +1172,7 @@ static int __devinit adis16400_probe(struct spi_device *spi) ...@@ -1172,7 +1172,7 @@ static int __devinit adis16400_probe(struct spi_device *spi)
return 0; return 0;
error_remove_trigger: error_remove_trigger:
if (indio_dev->modes & INDIO_BUFFER_TRIGGERED) if (spi->irq)
adis16400_remove_trigger(indio_dev); adis16400_remove_trigger(indio_dev);
error_uninitialize_ring: error_uninitialize_ring:
iio_buffer_unregister(indio_dev); iio_buffer_unregister(indio_dev);
......
...@@ -800,7 +800,7 @@ static int __devinit ade7758_probe(struct spi_device *spi) ...@@ -800,7 +800,7 @@ static int __devinit ade7758_probe(struct spi_device *spi)
return 0; return 0;
error_remove_trigger: error_remove_trigger:
if (indio_dev->modes & INDIO_BUFFER_TRIGGERED) if (spi->irq)
ade7758_remove_trigger(indio_dev); ade7758_remove_trigger(indio_dev);
error_uninitialize_ring: error_uninitialize_ring:
ade7758_uninitialize_ring(indio_dev); ade7758_uninitialize_ring(indio_dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment