iio: proximity: lidar: correct return value
authorMatt Ranostay <mranostay@gmail.com>
Sun, 27 Dec 2015 04:56:30 +0000 (20:56 -0800)
committerJonathan Cameron <jic23@kernel.org>
Sun, 3 Jan 2016 17:54:08 +0000 (17:54 +0000)
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>
drivers/iio/proximity/pulsedlight-lidar-lite-v2.c

index 93e29fb67fa00f94e9ca0a614addfc5cde7ebb76..db35e04a063767a9b2b6011cf3d0345c9d0929bd 100644 (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);
 
-       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)
This page took 0.024609 seconds and 5 git commands to generate.