]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
iio: adc: ad7280a: fix ad7280_store_balance_timer()
authorDavid Lechner <dlechner@baylibre.com>
Fri, 10 Oct 2025 15:44:45 +0000 (10:44 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 6 Dec 2025 21:24:58 +0000 (06:24 +0900)
commit bd886cdcbf9e746f61c74035a3acd42e9108e115 upstream.

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: 96ccdbc07a74 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/adc/ad7280a.c

index 35aa39fe4bde62290996abd3076ac350eedf1052..37522dca2c7c8c3482f6265835351f899cdde0fe 100644 (file)
@@ -541,7 +541,7 @@ static ssize_t ad7280_store_balance_timer(struct iio_dev *indio_dev,
        int val, val2;
        int ret;
 
-       ret = iio_str_to_fixpoint(buf, 1000, &val, &val2);
+       ret = iio_str_to_fixpoint(buf, 100, &val, &val2);
        if (ret)
                return ret;