From: Jonathan Cameron <jic23@kernel.org>
To: linux-iio@vger.kernel.org
Cc: Jonathan Cameron <jic23@kernel.org>
Subject: [PATCH 3/5] staging:iio: use spi->irq valid rather than querying available modes
Date: Sat, 3 Mar 2012 11:39:13 +0000 [thread overview]
Message-ID: <1330774755-18031-4-git-send-email-jic23@kernel.org> (raw)
In-Reply-To: <1330774755-18031-1-git-send-email-jic23@kernel.org>
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>
---
drivers/staging/iio/imu/adis16400_core.c | 2 +-
drivers/staging/iio/meter/ade7758_core.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/iio/imu/adis16400_core.c b/drivers/staging/iio/imu/adis16400_core.c
index e73ad78..a027d6d 100644
--- a/drivers/staging/iio/imu/adis16400_core.c
+++ b/drivers/staging/iio/imu/adis16400_core.c
@@ -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);
diff --git a/drivers/staging/iio/meter/ade7758_core.c b/drivers/staging/iio/meter/ade7758_core.c
index dcb2029..9374d6b 100644
--- a/drivers/staging/iio/meter/ade7758_core.c
+++ b/drivers/staging/iio/meter/ade7758_core.c
@@ -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);
--
1.7.9.2
next prev parent reply other threads:[~2012-03-03 11:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-03 11:39 [PATCH 0/5] IIO mixed bag of trivial + fixes Jonathan Cameron
2012-03-03 11:39 ` [PATCH 1/5] staging:iio fill in some missing docs Jonathan Cameron
2012-03-03 11:39 ` [PATCH 2/5] staging:iio:accel:lis3l02dq add symmetry to check for presence of trigger Jonathan Cameron
2012-03-03 11:39 ` Jonathan Cameron [this message]
2012-03-03 11:39 ` [PATCH 4/5] staging:iio:adc:max1363 fix missing update_scan_mask callback Jonathan Cameron
2012-03-03 11:39 ` [PATCH 5/5] staging:iio:iio_core.h make less dependent on other included headers Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1330774755-18031-4-git-send-email-jic23@kernel.org \
--to=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).