From 8b1f52278f544af608d576e8db2b79ed651a9414 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Tue, 10 Apr 2012 21:11:08 +0100 Subject: [PATCH] staging:iio:accel:lis3l02dq add symmetry to check for presence of trigger. 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 Signed-off-by: Greg Kroah-Hartman --- drivers/staging/iio/accel/lis3l02dq_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/iio/accel/lis3l02dq_core.c b/drivers/staging/iio/accel/lis3l02dq_core.c index 376da5137967..bcf47123dd6d 100644 --- a/drivers/staging/iio/accel/lis3l02dq_core.c +++ b/drivers/staging/iio/accel/lis3l02dq_core.c @@ -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) -- 2.39.5