diff options
author | Matt Ranostay <mranostay@gmail.com> | 2015-12-27 05:56:30 +0100 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2016-01-03 18:54:08 +0100 |
commit | 9979e320b559264333a77c73131ae88cefca15e5 (patch) | |
tree | 38591004a2cd55065a3ac635ddd031d475818cf8 /drivers/iio/proximity | |
parent | Merge tag 'iio-for-4.5c' of git://git.kernel.org/pub/scm/linux/kernel/git/jic... (diff) | |
download | linux-9979e320b559264333a77c73131ae88cefca15e5.tar.xz linux-9979e320b559264333a77c73131ae88cefca15e5.zip |
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')
-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) |