mirror of
https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux
synced 2025-09-15 00:56:46 +10:00
watchdog: starfive: Remove #ifdef guards for PM related functions
Use the new PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20230706082928.10869-1-paul@crapouillou.net Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
This commit is contained in:
parent
aeb3ef51b6
commit
8b3c366218
@ -527,7 +527,6 @@ static void starfive_wdt_shutdown(struct platform_device *pdev)
|
|||||||
starfive_wdt_pm_stop(&wdt->wdd);
|
starfive_wdt_pm_stop(&wdt->wdd);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM_SLEEP
|
|
||||||
static int starfive_wdt_suspend(struct device *dev)
|
static int starfive_wdt_suspend(struct device *dev)
|
||||||
{
|
{
|
||||||
struct starfive_wdt *wdt = dev_get_drvdata(dev);
|
struct starfive_wdt *wdt = dev_get_drvdata(dev);
|
||||||
@ -557,9 +556,7 @@ static int starfive_wdt_resume(struct device *dev)
|
|||||||
|
|
||||||
return starfive_wdt_start(wdt);
|
return starfive_wdt_start(wdt);
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_PM_SLEEP */
|
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
|
||||||
static int starfive_wdt_runtime_suspend(struct device *dev)
|
static int starfive_wdt_runtime_suspend(struct device *dev)
|
||||||
{
|
{
|
||||||
struct starfive_wdt *wdt = dev_get_drvdata(dev);
|
struct starfive_wdt *wdt = dev_get_drvdata(dev);
|
||||||
@ -575,11 +572,10 @@ static int starfive_wdt_runtime_resume(struct device *dev)
|
|||||||
|
|
||||||
return starfive_wdt_enable_clock(wdt);
|
return starfive_wdt_enable_clock(wdt);
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_PM */
|
|
||||||
|
|
||||||
static const struct dev_pm_ops starfive_wdt_pm_ops = {
|
static const struct dev_pm_ops starfive_wdt_pm_ops = {
|
||||||
SET_RUNTIME_PM_OPS(starfive_wdt_runtime_suspend, starfive_wdt_runtime_resume, NULL)
|
RUNTIME_PM_OPS(starfive_wdt_runtime_suspend, starfive_wdt_runtime_resume, NULL)
|
||||||
SET_SYSTEM_SLEEP_PM_OPS(starfive_wdt_suspend, starfive_wdt_resume)
|
SYSTEM_SLEEP_PM_OPS(starfive_wdt_suspend, starfive_wdt_resume)
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct of_device_id starfive_wdt_match[] = {
|
static const struct of_device_id starfive_wdt_match[] = {
|
||||||
@ -595,7 +591,7 @@ static struct platform_driver starfive_wdt_driver = {
|
|||||||
.shutdown = starfive_wdt_shutdown,
|
.shutdown = starfive_wdt_shutdown,
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "starfive-wdt",
|
.name = "starfive-wdt",
|
||||||
.pm = &starfive_wdt_pm_ops,
|
.pm = pm_ptr(&starfive_wdt_pm_ops),
|
||||||
.of_match_table = starfive_wdt_match,
|
.of_match_table = starfive_wdt_match,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user