Re: [PATCH] hwmon: gpio-fan: allow to stop FANs when CONFIG_PM is disabled
From: Guenter Roeck
Date: Mon Feb 02 2026 - 12:01:03 EST
On Mon, Feb 02, 2026 at 04:58:57PM +0100, Gabor Juhos wrote:
> When CONFIG_PM is disabled, the GPIO controlled FANs can't be stopped by
> using the sysfs attributes since commit 0d01110e6356 ("hwmon: (gpio-fan)
> Add regulator support").
>
> Using either the 'pwm1' or the 'fan1_target' attribute fails the same way:
>
> $ echo 0 > /sys/class/hwmon/hwmon1/pwm1
> ash: write error: Function not implemented
> $ echo 0 > /sys/class/hwmon/hwmon1/fan1_target
> ash: write error: Function not implemented
>
> Both commands were working flawlessly before the mentioned commit.
>
> The issue happens because pm_runtime_put_sync() returns with -ENOSYS
> when CONFIG_PM is disabled, and the set_fan_speed() function handles
> this as an error.
>
> In order to restore the previous behaviour, change the error check in
> the set_fan_speed() function to ignore the -ENOSYS error code.
>
> Cc: stable@xxxxxxxxxxxxxxx
> Fixes: 0d01110e6356 ("hwmon: (gpio-fan) Add regulator support")
> Signed-off-by: Gabor Juhos <j4g8y7@xxxxxxxxx>
Applied.
Thanks,
Guenter