]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/blobdiff - drivers/hwmon/pwm-fan.c
Merge tag 'hwmon-for-v5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck...
[mirror_ubuntu-eoan-kernel.git] / drivers / hwmon / pwm-fan.c
index 08c9b9f1c16e9e0e829decdbeb120fcfdeb8b848..54c0ff00d67fe731e9cdacd6ae8dcafaf0dbc566 100644 (file)
@@ -320,8 +320,10 @@ static int pwm_fan_probe(struct platform_device *pdev)
                        dev_err(dev, "Failed to enable fan supply: %d\n", ret);
                        return ret;
                }
-               devm_add_action_or_reset(dev, pwm_fan_regulator_disable,
-                                        ctx->reg_en);
+               ret = devm_add_action_or_reset(dev, pwm_fan_regulator_disable,
+                                              ctx->reg_en);
+               if (ret)
+                       return ret;
        }
 
        ctx->pwm_value = MAX_PWM;
@@ -337,7 +339,9 @@ static int pwm_fan_probe(struct platform_device *pdev)
                return ret;
        }
        timer_setup(&ctx->rpm_timer, sample_timer, 0);
-       devm_add_action_or_reset(dev, pwm_fan_pwm_disable, ctx);
+       ret = devm_add_action_or_reset(dev, pwm_fan_pwm_disable, ctx);
+       if (ret)
+               return ret;
 
        of_property_read_u32(dev->of_node, "pulses-per-revolution", &ppr);
        ctx->pulses_per_revolution = ppr;