iio: pressure: dps310: support negative temperature values
authorThomas Haemmerle <thomas.haemmerle@leica-geosystems.com>
Mon, 15 Apr 2024 10:50:27 +0000 (12:50 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 20 Apr 2024 13:53:01 +0000 (14:53 +0100)
commit9dd6b32e76ff714308964cd9ec91466a343dcb8b
tree6641463b6763a878a9f8725094e55c3d31b91f7a
parent499eb311513fa30e136d01abfb316c482379afa1
iio: pressure: dps310: support negative temperature values

The current implementation interprets negative values returned from
`dps310_calculate_temp` as error codes.
This has a side effect that when negative temperature values are
calculated, they are interpreted as error.

Fix this by using the return value only for error handling and passing a
pointer for the value.

Fixes: ba6ec48e76bc ("iio: Add driver for Infineon DPS310")
Signed-off-by: Thomas Haemmerle <thomas.haemmerle@leica-geosystems.com>
Link: https://lore.kernel.org/r/20240415105030.1161770-2-thomas.haemmerle@leica-geosystems.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/pressure/dps310.c