aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hwmon/pwm-fan.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/hwmon/pwm-fan.c b/drivers/hwmon/pwm-fan.c
index 936aaf76dd6e..7da6a160d45a 100644
--- a/drivers/hwmon/pwm-fan.c
+++ b/drivers/hwmon/pwm-fan.c
@@ -294,9 +294,19 @@ static int pwm_fan_remove(struct platform_device *pdev)
294static int pwm_fan_suspend(struct device *dev) 294static int pwm_fan_suspend(struct device *dev)
295{ 295{
296 struct pwm_fan_ctx *ctx = dev_get_drvdata(dev); 296 struct pwm_fan_ctx *ctx = dev_get_drvdata(dev);
297 struct pwm_args args;
298 int ret;
299
300 pwm_get_args(ctx->pwm, &args);
301
302 if (ctx->pwm_value) {
303 ret = pwm_config(ctx->pwm, 0, args.period);
304 if (ret < 0)
305 return ret;
297 306
298 if (ctx->pwm_value)
299 pwm_disable(ctx->pwm); 307 pwm_disable(ctx->pwm);
308 }
309
300 return 0; 310 return 0;
301} 311}
302 312