diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-06-17 09:31:12 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-06-17 09:31:12 +0300 |
commit | 20460472952043a4735e9abc1fd9de8e024d1c9e (patch) | |
tree | 8a9f91828816c3cb3b8fc019dce28d128e13dfef /drivers/iio/pressure | |
parent | 2db573c5dc1f896d8c6c73d4bdb6429f8b1dcf34 (diff) | |
parent | 6ba59ff4227927d3a8530fc2973b80e94b54d58f (diff) | |
download | linux-20460472952043a4735e9abc1fd9de8e024d1c9e.tar.xz |
Merge tag 'v6.10-rc4' into char-misc-next
We need the char-misc and iio fixes in here as well to build on top of.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/iio/pressure')
-rw-r--r-- | drivers/iio/pressure/bmp280-core.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/iio/pressure/bmp280-core.c b/drivers/iio/pressure/bmp280-core.c index 8d26161df2b0..50d71ad83f37 100644 --- a/drivers/iio/pressure/bmp280-core.c +++ b/drivers/iio/pressure/bmp280-core.c @@ -1463,12 +1463,12 @@ static int bmp580_read_temp(struct bmp280_data *data, int *val, int *val2) /* * Temperature is returned in Celsius degrees in fractional - * form down 2^16. We rescale by x1000 to return milli Celsius - * to respect IIO ABI. + * form down 2^16. We rescale by x1000 to return millidegrees + * Celsius to respect IIO ABI. */ - *val = raw_temp * 1000; - *val2 = 16; - return IIO_VAL_FRACTIONAL_LOG2; + raw_temp = sign_extend32(raw_temp, 23); + *val = ((s64)raw_temp * 1000) / (1 << 16); + return IIO_VAL_INT; } static int bmp580_read_press(struct bmp280_data *data, int *val, int *val2) |