[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20260123121458.3612-1-tumic@gpxsee.org>
Date: Fri, 23 Jan 2026 13:14:58 +0100
From: tumic@...see.org
To: Mauro Carvalho Chehab <mchehab@...nel.org>,
Hans Verkuil <hverkuil@...all.nl>
Cc: linux-media@...r.kernel.org,
linux-kernel@...r.kernel.org,
Martin Tůma <martin.tuma@...iteqautomotive.com>
Subject: [PATCH] media:pci:mgb4: Fixed negative hwmon temperatures processing
From: Martin Tůma <martin.tuma@...iteqautomotive.com>
The "magic" temperature formula must be computed using a signed integer for
negative temperatures to work properly.
Signed-off-by: Martin Tůma <martin.tuma@...iteqautomotive.com>
---
drivers/media/pci/mgb4/mgb4_core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/media/pci/mgb4/mgb4_core.c b/drivers/media/pci/mgb4/mgb4_core.c
index a7cb8dc50b53..0fd6c1c95abc 100644
--- a/drivers/media/pci/mgb4/mgb4_core.c
+++ b/drivers/media/pci/mgb4/mgb4_core.c
@@ -84,7 +84,8 @@ static int temp_read(struct device *dev, enum hwmon_sensor_types type, u32 attr,
int channel, long *val)
{
struct mgb4_dev *mgbdev = dev_get_drvdata(dev);
- u32 val10, raw;
+ u32 raw;
+ int val10;
if (type != hwmon_temp || attr != hwmon_temp_input)
return -EOPNOTSUPP;
base-commit: eb4ee870747c3a77a9c3c84d84efb64bd481013a
--
2.52.0
Powered by blists - more mailing lists