Skip to content

Commit

Permalink
staging:iio: use spi->irq valid rather than querying available modes
Browse files Browse the repository at this point in the history
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: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed Apr 10, 2012
1 parent 8b1f522 commit 487db48
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/staging/iio/imu/adis16400_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,7 @@ static int __devinit adis16400_probe(struct spi_device *spi)
return 0;

error_remove_trigger:
if (indio_dev->modes & INDIO_BUFFER_TRIGGERED)
if (spi->irq)
adis16400_remove_trigger(indio_dev);
error_uninitialize_ring:
iio_buffer_unregister(indio_dev);
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/iio/meter/ade7758_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ static int __devinit ade7758_probe(struct spi_device *spi)
return 0;

error_remove_trigger:
if (indio_dev->modes & INDIO_BUFFER_TRIGGERED)
if (spi->irq)
ade7758_remove_trigger(indio_dev);
error_uninitialize_ring:
ade7758_uninitialize_ring(indio_dev);
Expand Down

0 comments on commit 487db48

Please sign in to comment.