Re: [hwmon PATCH v2 6/8] hwmon: (adt7470) Use cached PWM frequency value
From: Guenter Roeck
Date: Mon Jul 27 2026 - 21:03:05 EST
On Mon, Jul 27, 2026 at 09:22:22PM -0300, Luiz Angelo Daros de Luca wrote:
> adt7470_pwm_read() currently ignores failures returned by
> pwm1_freq_get(). If the register read fails, the negative error code is
> returned through *val while the function itself reports success,
> potentially exposing a negative PWM frequency through sysfs.
>
> Fix this by using the cached PWM frequency maintained by the driver,
> eliminating the register access from the read path.
>
> Apart from the corrected error propagation and using the cached value,
> no functional change is intended.
>
> Fixes: ef67959c4253 ("hwmon: (adt7470) Convert to use regmap")
> Signed-off-by: Luiz Angelo Daros de Luca <luizluca@xxxxxxxxx>
Applied.
Thanks,
Guenter