linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: chemical: atlas-ph-sensor: use regmap_bulk_read
@ 2016-02-15  2:59 Matt Ranostay
  2016-02-21 20:34 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Matt Ranostay @ 2016-02-15  2:59 UTC (permalink / raw)
  To: jic23; +Cc: linux-iio, Matt Ranostay

Replaced i2c_smbus_read_i2c_block_data() with regmap_bulk_read()
function call. This is to make the driver code more consistent.

Signed-off-by: Matt Ranostay <mranostay@gmail.com>
---
 drivers/iio/chemical/atlas-ph-sensor.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/chemical/atlas-ph-sensor.c b/drivers/iio/chemical/atlas-ph-sensor.c
index 06cd49c..93fcea9 100644
--- a/drivers/iio/chemical/atlas-ph-sensor.c
+++ b/drivers/iio/chemical/atlas-ph-sensor.c
@@ -180,10 +180,10 @@ static irqreturn_t atlas_trigger_handler(int irq, void *private)
 	struct atlas_data *data = iio_priv(indio_dev);
 	int ret;
 
-	ret = i2c_smbus_read_i2c_block_data(data->client, ATLAS_REG_PH_DATA,
-				sizeof(data->buffer[0]), (u8 *) &data->buffer);
+	ret = regmap_bulk_read(data->regmap, ATLAS_REG_PH_DATA,
+			      (u8 *) &data->buffer, sizeof(data->buffer[0]));
 
-	if (ret > 0)
+	if (!ret)
 		iio_push_to_buffers_with_timestamp(indio_dev, data->buffer,
 				iio_get_time_ns());
 
-- 
2.7.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-02-21 20:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-15  2:59 [PATCH] iio: chemical: atlas-ph-sensor: use regmap_bulk_read Matt Ranostay
2016-02-21 20:34 ` Jonathan Cameron

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).