Skip to content

Commit

Permalink
staging:iio:accel:lis3l02dq add symmetry to check for presence of tri…
Browse files Browse the repository at this point in the history
…gger.

Checking indio_dev->modes is uggly and not symmetric with the conditions
on whether triggers are allowed in the first place.

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 0b27d67 commit 8b1f522
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/iio/accel/lis3l02dq_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ static int __devinit lis3l02dq_probe(struct spi_device *spi)
return 0;

error_remove_trigger:
if (indio_dev->modes & INDIO_BUFFER_TRIGGERED)
if (spi->irq && gpio_is_valid(irq_to_gpio(spi->irq)))
lis3l02dq_remove_trigger(indio_dev);
error_free_interrupt:
if (spi->irq && gpio_is_valid(irq_to_gpio(spi->irq)) > 0)
Expand Down

0 comments on commit 8b1f522

Please sign in to comment.