Skip to content

Commit bd886cd

Browse files
dlechjic23
authored andcommitted
iio: adc: ad7280a: fix ad7280_store_balance_timer()
Use correct argument to iio_str_to_fixpoint() to parse 3 decimal places. iio_str_to_fixpoint() has a bit of an unintuitive API where the fract_mult parameter is the multiplier of the first decimal place as if it was already an integer. So to get 3 decimal places, fract_mult must be 100 rather than 1000. Fixes: 96ccdbc ("staging:iio:adc:ad7280a: Standardize extended ABI naming") Signed-off-by: David Lechner <dlechner@baylibre.com> Reviewed-by: Nuno Sá <nuno.sa@analog.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent 3db847d commit bd886cd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/iio/adc/ad7280a.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ static ssize_t ad7280_store_balance_timer(struct iio_dev *indio_dev,
541541
int val, val2;
542542
int ret;
543543

544-
ret = iio_str_to_fixpoint(buf, 1000, &val, &val2);
544+
ret = iio_str_to_fixpoint(buf, 100, &val, &val2);
545545
if (ret)
546546
return ret;
547547

0 commit comments

Comments
 (0)