Commit 6adb5591 authored by Fabio Estevam's avatar Fabio Estevam Committed by Wim Van Sebroeck

watchdog: imx2_wdt: Remove __maybe_unused notations

Use the DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros to
handle the .suspend/.resume callbacks.

These macros allow the suspend and resume functions to be automatically
dropped by the compiler when CONFIG_SUSPEND is disabled, without having
to use __maybe_unused notation.
Signed-off-by: default avatarFabio Estevam <festevam@denx.de>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240809020822.335682-1-festevam@gmail.comSigned-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@linux-watchdog.org>
parent 2d9d6d30
...@@ -379,7 +379,7 @@ static void imx2_wdt_shutdown(struct platform_device *pdev) ...@@ -379,7 +379,7 @@ static void imx2_wdt_shutdown(struct platform_device *pdev)
} }
/* Disable watchdog if it is active or non-active but still running */ /* Disable watchdog if it is active or non-active but still running */
static int __maybe_unused imx2_wdt_suspend(struct device *dev) static int imx2_wdt_suspend(struct device *dev)
{ {
struct watchdog_device *wdog = dev_get_drvdata(dev); struct watchdog_device *wdog = dev_get_drvdata(dev);
struct imx2_wdt_device *wdev = watchdog_get_drvdata(wdog); struct imx2_wdt_device *wdev = watchdog_get_drvdata(wdog);
...@@ -404,7 +404,7 @@ static int __maybe_unused imx2_wdt_suspend(struct device *dev) ...@@ -404,7 +404,7 @@ static int __maybe_unused imx2_wdt_suspend(struct device *dev)
} }
/* Enable watchdog and configure it if necessary */ /* Enable watchdog and configure it if necessary */
static int __maybe_unused imx2_wdt_resume(struct device *dev) static int imx2_wdt_resume(struct device *dev)
{ {
struct watchdog_device *wdog = dev_get_drvdata(dev); struct watchdog_device *wdog = dev_get_drvdata(dev);
struct imx2_wdt_device *wdev = watchdog_get_drvdata(wdog); struct imx2_wdt_device *wdev = watchdog_get_drvdata(wdog);
...@@ -435,8 +435,8 @@ static int __maybe_unused imx2_wdt_resume(struct device *dev) ...@@ -435,8 +435,8 @@ static int __maybe_unused imx2_wdt_resume(struct device *dev)
return 0; return 0;
} }
static SIMPLE_DEV_PM_OPS(imx2_wdt_pm_ops, imx2_wdt_suspend, static DEFINE_SIMPLE_DEV_PM_OPS(imx2_wdt_pm_ops, imx2_wdt_suspend,
imx2_wdt_resume); imx2_wdt_resume);
static struct imx2_wdt_data imx_wdt = { static struct imx2_wdt_data imx_wdt = {
.wdw_supported = true, .wdw_supported = true,
...@@ -476,7 +476,7 @@ static struct platform_driver imx2_wdt_driver = { ...@@ -476,7 +476,7 @@ static struct platform_driver imx2_wdt_driver = {
.shutdown = imx2_wdt_shutdown, .shutdown = imx2_wdt_shutdown,
.driver = { .driver = {
.name = DRIVER_NAME, .name = DRIVER_NAME,
.pm = &imx2_wdt_pm_ops, .pm = pm_sleep_ptr(&imx2_wdt_pm_ops),
.of_match_table = imx2_wdt_dt_ids, .of_match_table = imx2_wdt_dt_ids,
}, },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment