pwm: starfive: Remove macro UNIVERSAL_DEV_PM_OPS
authorHal Feng <hal.feng@starfivetech.com>
Fri, 21 Oct 2022 06:38:17 +0000 (14:38 +0800)
committermason.huo <mason.huo@starfivetech.com>
Thu, 27 Oct 2022 05:57:03 +0000 (13:57 +0800)
Because it causes error when system pm.

Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
drivers/pwm/pwm-starfive-ptc.c

index d09e9ae..746e6ce 100644 (file)
@@ -259,7 +259,7 @@ static int starfive_pwm_ptc_remove(struct platform_device *dev)
 }
 
 #if defined(CONFIG_PM) || defined(CONFIG_PM_SLEEP)
-static int __maybe_unused starfive_pwm_suspend(struct device *dev)
+static int __maybe_unused starfive_pwm_runtime_suspend(struct device *dev)
 {
        struct starfive_pwm_ptc_device *pwm = dev_get_drvdata(dev);
 
@@ -270,7 +270,7 @@ static int __maybe_unused starfive_pwm_suspend(struct device *dev)
        return 0;
 }
 
-static int __maybe_unused starfive_pwm_resume(struct device *dev)
+static int __maybe_unused starfive_pwm_runtime_resume(struct device *dev)
 {
        struct starfive_pwm_ptc_device *pwm = dev_get_drvdata(dev);
        int ret;
@@ -285,8 +285,12 @@ static int __maybe_unused starfive_pwm_resume(struct device *dev)
 }
 #endif
 
-static UNIVERSAL_DEV_PM_OPS(starfive_pwm_pm_ops, starfive_pwm_suspend,
-                           starfive_pwm_resume, NULL);
+static const struct dev_pm_ops starfive_pwm_pm_ops = {
+       SET_RUNTIME_PM_OPS(starfive_pwm_runtime_suspend,
+                          starfive_pwm_runtime_resume, NULL)
+       SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
+                               pm_runtime_force_resume)
+};
 
 static const struct of_device_id starfive_pwm_ptc_of_match[] = {
        { .compatible = "starfive,jh7110-pwm" },