Skip to contentSkip to conversation

hwmon: (aquacomputer_d5next) Fix incorrect PWM value readout

PATCH Applied Aleksa Savic 2 participants 2 messages Jul 14, 2023 – Jul 15, 2023

Subsystems (3)
lore
Share & tools
lore

Aleksa Savic

author maintainer
#0 lore raw

PATCH 1/1 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")
---
 drivers/hwmon/aquacomputer_d5next.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/aquacomputer_d5next.c +1 -1
index a981f7086114..a997dbcb563f 100644
@@ -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;
Signature · 1 line
2.35.0
maintainer Applied
#1 lore raw
Quoted 9 lines · Aleksa Savic

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")

Applied.

Thanks,
Guenter

Quoted 17 lines
---
 drivers/hwmon/aquacomputer_d5next.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/aquacomputer_d5next.c +1 -1
index a981f7086114..a997dbcb563f 100644
@@ -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;