Linux Hardware Monitor development
 help / color / mirror / Atom feed
* [PATCH] hwmon: (aquacomputer_d5next) Fix incorrect PWM value readout
@ 2023-07-14 12:07 Aleksa Savic
  2023-07-15 16:25 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Aleksa Savic @ 2023-07-14 12:07 UTC (permalink / raw)
  To: linux-hwmon
  Cc: Aleksa Savic, stable, Jack Doan, Jean Delvare, Guenter Roeck,
	linux-kernel

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@vger.kernel.org
Signed-off-by: Aleksa Savic <savicaleksa83@gmail.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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] hwmon: (aquacomputer_d5next) Fix incorrect PWM value readout
  2023-07-14 12:07 [PATCH] hwmon: (aquacomputer_d5next) Fix incorrect PWM value readout Aleksa Savic
@ 2023-07-15 16:25 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2023-07-15 16:25 UTC (permalink / raw)
  To: Aleksa Savic; +Cc: linux-hwmon, Jack Doan, Jean Delvare, linux-kernel

On Fri, Jul 14, 2023 at 02:07:11PM +0200, Aleksa Savic wrote:
> 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@vger.kernel.org
> Signed-off-by: Aleksa Savic <savicaleksa83@gmail.com>

Applied.

Thanks,
Guenter

> ---
>  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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-15 16:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-14 12:07 [PATCH] hwmon: (aquacomputer_d5next) Fix incorrect PWM value readout Aleksa Savic
2023-07-15 16:25 ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox