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>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
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());