iio: trigger: stm32-timer: fix write_raw return value
authorFabrice Gasnier <fabrice.gasnier@st.com>
Thu, 27 Jul 2017 16:18:58 +0000 (18:18 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 30 Jul 2017 13:44:28 +0000 (14:44 +0100)
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>
drivers/iio/trigger/stm32-timer-trigger.c

index 6aa73d6b28825ec48ccbae34418bab7d59de3e0f..107918b3a90bd04f954d3b64bbcc67c0cf4c8b64 100644 (file)
@@ -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;