Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <festevam@denx.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240809020822.335682-1-festevam@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>

authored by

Fabio Estevam and committed by
Wim Van Sebroeck
6adb5591 2d9d6d30

+5 -5
+5 -5
drivers/watchdog/imx2_wdt.c
··· 379 379 } 380 380 381 381 /* 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) 383 383 { 384 384 struct watchdog_device *wdog = dev_get_drvdata(dev); 385 385 struct imx2_wdt_device *wdev = watchdog_get_drvdata(wdog); ··· 404 404 } 405 405 406 406 /* 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) 408 408 { 409 409 struct watchdog_device *wdog = dev_get_drvdata(dev); 410 410 struct imx2_wdt_device *wdev = watchdog_get_drvdata(wdog); ··· 435 435 return 0; 436 436 } 437 437 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); 440 440 441 441 static struct imx2_wdt_data imx_wdt = { 442 442 .wdw_supported = true, ··· 476 476 .shutdown = imx2_wdt_shutdown, 477 477 .driver = { 478 478 .name = DRIVER_NAME, 479 - .pm = &imx2_wdt_pm_ops, 479 + .pm = pm_sleep_ptr(&imx2_wdt_pm_ops), 480 480 .of_match_table = imx2_wdt_dt_ids, 481 481 }, 482 482 };