mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-23 16:53:58 -05:00
watchdog: at91rm9200: Remove #ifdef guards for PM related functions
Use the pm_ptr() macro to handle the .suspend/.resume callbacks. This macro allows the suspend and resume functions to be automatically dropped by the compiler when CONFIG_SUSPEND is disabled, without having to use #ifdef guards. Not using #ifdef guards means that the code is always compiled independently of any Kconfig option, and thanks to that bugs and regressions are easier to catch. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com> Link: https://lore.kernel.org/r/20221020185047.1001522-2-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
08435c2aab
commit
b49e2a3cfb
2 changed files with 4 additions and 16 deletions
|
@ -278,8 +278,6 @@ static void at91wdt_shutdown(struct platform_device *pdev)
|
||||||
at91_wdt_stop();
|
at91_wdt_stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
|
||||||
|
|
||||||
static int at91wdt_suspend(struct platform_device *pdev, pm_message_t message)
|
static int at91wdt_suspend(struct platform_device *pdev, pm_message_t message)
|
||||||
{
|
{
|
||||||
at91_wdt_stop();
|
at91_wdt_stop();
|
||||||
|
@ -293,11 +291,6 @@ static int at91wdt_resume(struct platform_device *pdev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
|
||||||
#define at91wdt_suspend NULL
|
|
||||||
#define at91wdt_resume NULL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static const struct of_device_id at91_wdt_dt_ids[] = {
|
static const struct of_device_id at91_wdt_dt_ids[] = {
|
||||||
{ .compatible = "atmel,at91rm9200-wdt" },
|
{ .compatible = "atmel,at91rm9200-wdt" },
|
||||||
{ /* sentinel */ }
|
{ /* sentinel */ }
|
||||||
|
@ -308,8 +301,8 @@ static struct platform_driver at91wdt_driver = {
|
||||||
.probe = at91wdt_probe,
|
.probe = at91wdt_probe,
|
||||||
.remove = at91wdt_remove,
|
.remove = at91wdt_remove,
|
||||||
.shutdown = at91wdt_shutdown,
|
.shutdown = at91wdt_shutdown,
|
||||||
.suspend = at91wdt_suspend,
|
.suspend = pm_ptr(at91wdt_suspend),
|
||||||
.resume = at91wdt_resume,
|
.resume = pm_ptr(at91wdt_resume),
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "atmel_st_watchdog",
|
.name = "atmel_st_watchdog",
|
||||||
.of_match_table = at91_wdt_dt_ids,
|
.of_match_table = at91_wdt_dt_ids,
|
||||||
|
|
|
@ -105,7 +105,6 @@ static int db8500_wdt_probe(struct platform_device *pdev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
|
||||||
static int db8500_wdt_suspend(struct platform_device *pdev,
|
static int db8500_wdt_suspend(struct platform_device *pdev,
|
||||||
pm_message_t state)
|
pm_message_t state)
|
||||||
{
|
{
|
||||||
|
@ -130,15 +129,11 @@ static int db8500_wdt_resume(struct platform_device *pdev)
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
#define db8500_wdt_suspend NULL
|
|
||||||
#define db8500_wdt_resume NULL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static struct platform_driver db8500_wdt_driver = {
|
static struct platform_driver db8500_wdt_driver = {
|
||||||
.probe = db8500_wdt_probe,
|
.probe = db8500_wdt_probe,
|
||||||
.suspend = db8500_wdt_suspend,
|
.suspend = pm_ptr(db8500_wdt_suspend),
|
||||||
.resume = db8500_wdt_resume,
|
.resume = pm_ptr(db8500_wdt_resume),
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "db8500_wdt",
|
.name = "db8500_wdt",
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue