提交 a096926e 编写于 作者: E Enric Balletbo i Serra 提交者: Jonathan Cameron

iio: cros_ec_sensors: Fix return value to get raw and calibbias data.

The cros_ec_sensors_read function must return the type of value on all
cases. This was always true except for RAW and CALIBBIAS data which
returned an error or 0. This patch just fixes the mistake I introduced
when submitting the series.

Fixes: commit c14dca07 (iio: cros_ec_sensors: add ChromeOS EC
Contiguous Sensors driver)
Signed-off-by: NEnric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: NJonathan Cameron <jic23@kernel.org>
上级 43c49938
...@@ -61,7 +61,7 @@ static int cros_ec_sensors_read(struct iio_dev *indio_dev, ...@@ -61,7 +61,7 @@ static int cros_ec_sensors_read(struct iio_dev *indio_dev,
ret = st->core.read_ec_sensors_data(indio_dev, 1 << idx, &data); ret = st->core.read_ec_sensors_data(indio_dev, 1 << idx, &data);
if (ret < 0) if (ret < 0)
break; break;
ret = IIO_VAL_INT;
*val = data; *val = data;
break; break;
case IIO_CHAN_INFO_CALIBBIAS: case IIO_CHAN_INFO_CALIBBIAS:
...@@ -76,7 +76,7 @@ static int cros_ec_sensors_read(struct iio_dev *indio_dev, ...@@ -76,7 +76,7 @@ static int cros_ec_sensors_read(struct iio_dev *indio_dev,
for (i = CROS_EC_SENSOR_X; i < CROS_EC_SENSOR_MAX_AXIS; i++) for (i = CROS_EC_SENSOR_X; i < CROS_EC_SENSOR_MAX_AXIS; i++)
st->core.calib[i] = st->core.calib[i] =
st->core.resp->sensor_offset.offset[i]; st->core.resp->sensor_offset.offset[i];
ret = IIO_VAL_INT;
*val = st->core.calib[idx]; *val = st->core.calib[idx];
break; break;
case IIO_CHAN_INFO_SCALE: case IIO_CHAN_INFO_SCALE:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册