From 0924f7ed0c17c9aee75c269d8ed825b8fbfb3fa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Fri, 23 Jan 2026 13:14:58 +0100 Subject: [PATCH] media:pci:mgb4: Fixed negative hwmon temperatures processing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "magic" temperature formula must be computed using a signed integer for negative temperatures to work properly. Signed-off-by: Martin Tůma Signed-off-by: Hans Verkuil --- 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 a7351a469386..d23d854581c5 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;