]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
iio: light: bu27008: Fix intensity data type
authorMatti Vaittinen <mazziesaccount@gmail.com>
Tue, 13 Jun 2023 09:35:12 +0000 (12:35 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 15 Jul 2023 17:02:02 +0000 (18:02 +0100)
The intensity data from bu27008 is unsigned. The type of the scan data
was incorrectly marked as signed resulting large intensity values to be
interpreted as negative ones.

Fix the scan data type.

Fixes: 41ff93d14f78 ("iio: light: ROHM BU27008 color sensor")
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://lore.kernel.org/r/240a7ca5fc1b76da20d81f930d00f31a54b1fdf8.1686648422.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/light/rohm-bu27008.c

index 80eb14ea8193fecd46f4a9656cd9869202684f47..b50bf8973d9ad140ceaa9ffb1377afa4fb3dbe93 100644 (file)
@@ -190,7 +190,7 @@ static const struct iio_itime_sel_mul bu27008_itimes[] = {
        .address = BU27008_REG_##data##_LO,                                     \
        .scan_index = BU27008_##color,                                          \
        .scan_type = {                                                          \
-               .sign = 's',                                                    \
+               .sign = 'u',                                                    \
                .realbits = 16,                                                 \
                .storagebits = 16,                                              \
                .endianness = IIO_LE,                                           \