mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-14 06:24:53 +08:00
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:
parent
02c34ccc1d
commit
9979e320b5
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user