[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230714120712.16721-1-savicaleksa83@gmail.com>
Date: Fri, 14 Jul 2023 14:07:11 +0200
From: Aleksa Savic <savicaleksa83@...il.com>
To: linux-hwmon@...r.kernel.org
Cc: Aleksa Savic <savicaleksa83@...il.com>, stable@...r.kernel.org,
Jack Doan <me@...kdoan.com>, Jean Delvare <jdelvare@...e.com>,
Guenter Roeck <linux@...ck-us.net>,
linux-kernel@...r.kernel.org
Subject: [PATCH] hwmon: (aquacomputer_d5next) Fix incorrect PWM value readout
Commit 662d20b3a5af ("hwmon: (aquacomputer_d5next) Add support for
temperature sensor offsets") changed aqc_get_ctrl_val() to return
the value through a parameter instead of through the return value,
but didn't fix up a case that relied on the old behavior. Fix it
to use the proper received value and not the return code.
Fixes: 662d20b3a5af ("hwmon: (aquacomputer_d5next) Add support for temperature sensor offsets")
Cc: stable@...r.kernel.org
Signed-off-by: Aleksa Savic <savicaleksa83@...il.com>
---
drivers/hwmon/aquacomputer_d5next.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwmon/aquacomputer_d5next.c b/drivers/hwmon/aquacomputer_d5next.c
index a981f7086114..a997dbcb563f 100644
--- a/drivers/hwmon/aquacomputer_d5next.c
+++ b/drivers/hwmon/aquacomputer_d5next.c
@@ -1027,7 +1027,7 @@ static int aqc_read(struct device *dev, enum hwmon_sensor_types type, u32 attr,
if (ret < 0)
return ret;
- *val = aqc_percent_to_pwm(ret);
+ *val = aqc_percent_to_pwm(*val);
break;
}
break;
--
2.35.0
Powered by blists - more mailing lists