iio: proximity: lidar: correct return value

lidar_i2c_xfer() function was never a non-positive value on error,
and this correct that with a -EIO return code.

Fixes: 366e65633c ("iio: proximity: lidar: optimize i2c transactions")
Signed-off-by: Matt Ranostay <mranostay@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
Matt Ranostay 2015-12-26 20:56:30 -08:00 committed by Jonathan Cameron
parent 02c34ccc1d
commit 9979e320b5

View File

@ -87,7 +87,7 @@ static int lidar_i2c_xfer(struct lidar_data *data, u8 reg, u8 *val, int len)
ret = i2c_transfer(client->adapter, msg, 2); ret = i2c_transfer(client->adapter, msg, 2);
return (ret == 2) ? 0 : ret; return (ret == 2) ? 0 : -EIO;
} }
static int lidar_smbus_xfer(struct lidar_data *data, u8 reg, u8 *val, int len) static int lidar_smbus_xfer(struct lidar_data *data, u8 reg, u8 *val, int len)