Skip to content

Commit 6adb559

Browse files
Fabio EstevamWim Van Sebroeck
authored andcommitted
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: Fabio Estevam <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
1 parent 2d9d6d3 commit 6adb559

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/watchdog/imx2_wdt.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ static void imx2_wdt_shutdown(struct platform_device *pdev)
379379
}
380380

381381
/* Disable watchdog if it is active or non-active but still running */
382-
static int __maybe_unused imx2_wdt_suspend(struct device *dev)
382+
static int imx2_wdt_suspend(struct device *dev)
383383
{
384384
struct watchdog_device *wdog = dev_get_drvdata(dev);
385385
struct imx2_wdt_device *wdev = watchdog_get_drvdata(wdog);
@@ -404,7 +404,7 @@ static int __maybe_unused imx2_wdt_suspend(struct device *dev)
404404
}
405405

406406
/* Enable watchdog and configure it if necessary */
407-
static int __maybe_unused imx2_wdt_resume(struct device *dev)
407+
static int imx2_wdt_resume(struct device *dev)
408408
{
409409
struct watchdog_device *wdog = dev_get_drvdata(dev);
410410
struct imx2_wdt_device *wdev = watchdog_get_drvdata(wdog);
@@ -435,8 +435,8 @@ static int __maybe_unused imx2_wdt_resume(struct device *dev)
435435
return 0;
436436
}
437437

438-
static SIMPLE_DEV_PM_OPS(imx2_wdt_pm_ops, imx2_wdt_suspend,
439-
imx2_wdt_resume);
438+
static DEFINE_SIMPLE_DEV_PM_OPS(imx2_wdt_pm_ops, imx2_wdt_suspend,
439+
imx2_wdt_resume);
440440

441441
static struct imx2_wdt_data imx_wdt = {
442442
.wdw_supported = true,
@@ -476,7 +476,7 @@ static struct platform_driver imx2_wdt_driver = {
476476
.shutdown = imx2_wdt_shutdown,
477477
.driver = {
478478
.name = DRIVER_NAME,
479-
.pm = &imx2_wdt_pm_ops,
479+
.pm = pm_sleep_ptr(&imx2_wdt_pm_ops),
480480
.of_match_table = imx2_wdt_dt_ids,
481481
},
482482
};

0 commit comments

Comments
 (0)