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

watchdog: da9063: 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/20241018135821.274376-2-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
90fc2c8e 076354a4

+5 -5
+5 -5
drivers/watchdog/da9063_wdt.c
··· 263 263 return devm_watchdog_register_device(dev, wdd); 264 264 } 265 265 266 - static int __maybe_unused da9063_wdt_suspend(struct device *dev) 266 + static int da9063_wdt_suspend(struct device *dev) 267 267 { 268 268 struct watchdog_device *wdd = dev_get_drvdata(dev); 269 269 struct da9063 *da9063 = watchdog_get_drvdata(wdd); ··· 277 277 return 0; 278 278 } 279 279 280 - static int __maybe_unused da9063_wdt_resume(struct device *dev) 280 + static int da9063_wdt_resume(struct device *dev) 281 281 { 282 282 struct watchdog_device *wdd = dev_get_drvdata(dev); 283 283 struct da9063 *da9063 = watchdog_get_drvdata(wdd); ··· 291 291 return 0; 292 292 } 293 293 294 - static SIMPLE_DEV_PM_OPS(da9063_wdt_pm_ops, 295 - da9063_wdt_suspend, da9063_wdt_resume); 294 + static DEFINE_SIMPLE_DEV_PM_OPS(da9063_wdt_pm_ops, da9063_wdt_suspend, 295 + da9063_wdt_resume); 296 296 297 297 static struct platform_driver da9063_wdt_driver = { 298 298 .probe = da9063_wdt_probe, 299 299 .driver = { 300 300 .name = DA9063_DRVNAME_WATCHDOG, 301 - .pm = &da9063_wdt_pm_ops, 301 + .pm = pm_sleep_ptr(&da9063_wdt_pm_ops), 302 302 }, 303 303 }; 304 304 module_platform_driver(da9063_wdt_driver);