]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Jun 2024 11:39:37 +0000 (13:39 +0200)
commitf437c761fc8a7ec8c3431b507171fc589e0dd2c3
treeeb088b7247467b7dd07fd4fc98e67fc470befa9a
parent39c2c97507c82045eb908a47a3f64ac18fc202e2
iio: pressure: dps310: support negative temperature values

[ Upstream commit 9dd6b32e76ff714308964cd9ec91466a343dcb8b ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iio/pressure/dps310.c