From: Matt Ranostay <mranostay@gmail.com>
To: linux-iio@vger.kernel.org
Cc: jic23@kernel.org, Matt Ranostay <mranostay@gmail.com>
Subject: [PATCH v2 1/3] iio: chemical: atlas-ph-sensor: switch to iio_device_*_direct_mode helpers
Date: Fri, 19 Aug 2016 13:36:09 -0700 [thread overview]
Message-ID: <1471638971-23039-2-git-send-email-mranostay@gmail.com> (raw)
In-Reply-To: <1471638971-23039-1-git-send-email-mranostay@gmail.com>
Signed-off-by: Matt Ranostay <mranostay@gmail.com>
---
drivers/iio/chemical/atlas-ph-sensor.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/iio/chemical/atlas-ph-sensor.c b/drivers/iio/chemical/atlas-ph-sensor.c
index ae038a59d256..696875413d10 100644
--- a/drivers/iio/chemical/atlas-ph-sensor.c
+++ b/drivers/iio/chemical/atlas-ph-sensor.c
@@ -402,15 +402,13 @@ static int atlas_read_raw(struct iio_dev *indio_dev,
case IIO_PH:
case IIO_CONCENTRATION:
case IIO_ELECTRICALCONDUCTIVITY:
- mutex_lock(&indio_dev->mlock);
+ ret = iio_device_claim_direct_mode(indio_dev);
+ if (ret)
+ return ret;
- if (iio_buffer_enabled(indio_dev))
- ret = -EBUSY;
- else
- ret = atlas_read_measurement(data,
- chan->address, ®);
+ ret = atlas_read_measurement(data, chan->address, ®);
- mutex_unlock(&indio_dev->mlock);
+ iio_device_release_direct_mode(indio_dev);
break;
default:
ret = -EINVAL;
--
2.7.4
next prev parent reply other threads:[~2016-08-19 20:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-19 20:36 [PATCH v2 0/3] iio: chemical: atlas-ph-sensor: add ORP feature Matt Ranostay
2016-08-19 20:36 ` Matt Ranostay [this message]
2016-08-21 10:56 ` [PATCH v2 1/3] iio: chemical: atlas-ph-sensor: switch to iio_device_*_direct_mode helpers Jonathan Cameron
2016-08-19 20:36 ` [PATCH v2 2/3] iio: chemical: atlas-ph-sensor: switch to REGCACHE_NONE regmap tree Matt Ranostay
2016-08-21 10:58 ` Jonathan Cameron
2016-08-19 20:36 ` [PATCH v2 3/3] iio: chemical: atlas-ph-sensor: add ORP feature Matt Ranostay
2016-08-21 11:00 ` 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=1471638971-23039-2-git-send-email-mranostay@gmail.com \
--to=mranostay@gmail.com \
--cc=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).