Skip to content

Commit 9979e32

Browse files
mranostayjic23
authored andcommitted
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: 366e656 ("iio: proximity: lidar: optimize i2c transactions") Signed-off-by: Matt Ranostay <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 02c34cc commit 9979e32

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iio/proximity/pulsedlight-lidar-lite-v2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ static int lidar_i2c_xfer(struct lidar_data *data, u8 reg, u8 *val, int len)
8787

8888
ret = i2c_transfer(client->adapter, msg, 2);
8989

90-
return (ret == 2) ? 0 : ret;
90+
return (ret == 2) ? 0 : -EIO;
9191
}
9292

9393
static int lidar_smbus_xfer(struct lidar_data *data, u8 reg, u8 *val, int len)

0 commit comments

Comments
 (0)