summaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorFabrice Gasnier <fabrice.gasnier@st.com>2017-07-27 18:18:58 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2017-07-30 14:44:28 +0100
commit1987a08cd989fd9e5690e90a04e70046e93315f4 (patch)
treec5f32a3a34184f0563b8dbd4c2bee437595b0194 /drivers/iio
parent50b39608efb1e60f334f9b59128fd6d970bfd5a6 (diff)
downloadtalos-obmc-linux-1987a08cd989fd9e5690e90a04e70046e93315f4.tar.gz
talos-obmc-linux-1987a08cd989fd9e5690e90a04e70046e93315f4.zip
iio: trigger: stm32-timer: fix write_raw return value
Fixes: 4adec7da0536 ("iio: stm32 trigger: Add quadrature encoder device") IIO core expects zero as return value for write_raw() callback in case of success. Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com> Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/trigger/stm32-timer-trigger.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/iio/trigger/stm32-timer-trigger.c b/drivers/iio/trigger/stm32-timer-trigger.c
index 6aa73d6b2882..107918b3a90b 100644
--- a/drivers/iio/trigger/stm32-timer-trigger.c
+++ b/drivers/iio/trigger/stm32-timer-trigger.c
@@ -406,9 +406,8 @@ static int stm32_counter_write_raw(struct iio_dev *indio_dev,
switch (mask) {
case IIO_CHAN_INFO_RAW:
- regmap_write(priv->regmap, TIM_CNT, val);
+ return regmap_write(priv->regmap, TIM_CNT, val);
- return IIO_VAL_INT;
case IIO_CHAN_INFO_SCALE:
/* fixed scale */
return -EINVAL;
OpenPOWER on IntegriCloud