1 From 53f1647da3e8fb3e89066798f0fdc045064d353d Mon Sep 17 00:00:00 2001
2 From: Stefan Wahren <stefan.wahren@i2se.com>
3 Date: Wed, 3 Apr 2019 14:48:33 +0200
4 Subject: hwmon: (pwm-fan) Disable PWM if fetching cooling data fails
6 From: Stefan Wahren <stefan.wahren@i2se.com>
8 commit 53f1647da3e8fb3e89066798f0fdc045064d353d upstream.
10 In case pwm_fan_of_get_cooling_data() fails we should disable the PWM
11 just like in the other error cases.
13 Fixes: 2e5219c77183 ("hwmon: (pwm-fan) Read PWM FAN configuration from device tree")
14 Cc: <stable@vger.kernel.org> # 4.14+
15 Reported-by: Guenter Rock <linux@roeck-us.net>
16 Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
17 Signed-off-by: Guenter Roeck <linux@roeck-us.net>
18 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
21 drivers/hwmon/pwm-fan.c | 2 +-
22 1 file changed, 1 insertion(+), 1 deletion(-)
24 --- a/drivers/hwmon/pwm-fan.c
25 +++ b/drivers/hwmon/pwm-fan.c
26 @@ -260,7 +260,7 @@ static int pwm_fan_probe(struct platform
28 ret = pwm_fan_of_get_cooling_data(&pdev->dev, ctx);
31 + goto err_pwm_disable;
33 ctx->pwm_fan_state = ctx->pwm_fan_max_state;
34 if (IS_ENABLED(CONFIG_THERMAL)) {