[PATCH] iio: chemical: atlas-ph-sensor: use regmap_bulk_read

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux