Skip to content

Commit

Permalink
iio: trigger: stm32-timer: fix write_raw return value
Browse files Browse the repository at this point in the history
Fixes: 4adec7d ("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>
  • Loading branch information
Fabrice Gasnier authored and Jonathan Cameron committed Jul 30, 2017
1 parent 50b3960 commit 1987a08
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/iio/trigger/stm32-timer-trigger.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1987a08

Please sign in to comment.