aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/hwmon/pwm-fan.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2022-12-22 09:11:48 +0100
committerTakashi Iwai <tiwai@suse.de>2022-12-22 09:11:48 +0100
commit2d78eb0342dd2c9c5cde9ae9ada1d33f189a858b (patch)
treef711bc9cab45f4963e4883ef15ff4c54a6cbc12e /drivers/hwmon/pwm-fan.c
parentMerge tag 'asoc-fix-v6.1-rc7' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus (diff)
parentALSA: hda/hdmi: fix stream-id config keep-alive for rt suspend (diff)
downloadwireguard-linux-2d78eb0342dd2c9c5cde9ae9ada1d33f189a858b.tar.xz
wireguard-linux-2d78eb0342dd2c9c5cde9ae9ada1d33f189a858b.zip
Merge branch 'for-next' into for-linus
Diffstat (limited to 'drivers/hwmon/pwm-fan.c')
-rw-r--r--drivers/hwmon/pwm-fan.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/hwmon/pwm-fan.c b/drivers/hwmon/pwm-fan.c
index dc3d9a22d917..83a347ca35da 100644
--- a/drivers/hwmon/pwm-fan.c
+++ b/drivers/hwmon/pwm-fan.c
@@ -257,7 +257,10 @@ static int pwm_fan_update_enable(struct pwm_fan_ctx *ctx, long val)
if (val == 0) {
/* Disable pwm-fan unconditionally */
- ret = __set_pwm(ctx, 0);
+ if (ctx->enabled)
+ ret = __set_pwm(ctx, 0);
+ else
+ ret = pwm_fan_switch_power(ctx, false);
if (ret)
ctx->enable_mode = old_val;
pwm_fan_update_state(ctx, 0);