Skip to content

Commit a2ca752

Browse files
billy-tsaigroeck
authored andcommitted
hwmon: (pwm-fan) Ensure the fan going on in .probe()
Before commit 86585c6 ("hwmon: (pwm-fan) stop using legacy PWM functions and some cleanups") pwm_apply_state() was called unconditionally in pwm_fan_probe(). In this commit this direct call was replaced by a call to __set_pwm(ct, MAX_PWM) which however is a noop if ctx->pwm_value already matches the value to set. After probe the fan is supposed to run at full speed, and the internal driver state suggests it does, but this isn't asserted and depending on bootloader and pwm low-level driver, the fan might just be off. So drop setting pwm_value to MAX_PWM to ensure the check in __set_pwm doesn't make it exit early and the fan goes on as intended. Cc: [email protected] Fixes: 86585c6 ("hwmon: (pwm-fan) stop using legacy PWM functions and some cleanups") Signed-off-by: Billy Tsai <[email protected]> Reviewed-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
1 parent 0e4190d commit a2ca752

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

drivers/hwmon/pwm-fan.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,6 @@ static int pwm_fan_probe(struct platform_device *pdev)
336336
return ret;
337337
}
338338

339-
ctx->pwm_value = MAX_PWM;
340-
341339
pwm_init_state(ctx->pwm, &ctx->pwm_state);
342340

343341
/*

0 commit comments

Comments
 (0)