diff options
author | Matt Ranostay <mranostay@gmail.com> | 2015-12-27 07:56:30 +0300 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2016-01-03 20:54:08 +0300 |
commit | 9979e320b559264333a77c73131ae88cefca15e5 (patch) | |
tree | 38591004a2cd55065a3ac635ddd031d475818cf8 /drivers/iio/proximity/pulsedlight-lidar-lite-v2.c | |
parent | 02c34ccc1d2d528d2de2897881b97933363432b5 (diff) | |
download | linux-9979e320b559264333a77c73131ae88cefca15e5.tar.xz |
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: 366e65633cf4 ("iio: proximity: lidar: optimize i2c transactions")
Signed-off-by: Matt Ranostay <mranostay@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/proximity/pulsedlight-lidar-lite-v2.c')
-rw-r--r-- | drivers/iio/proximity/pulsedlight-lidar-lite-v2.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c index 93e29fb67fa0..db35e04a0637 100644 --- a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c +++ b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c @@ -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); - 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) |