Skip to content

Commit 90fc2c8

Browse files
Fabio EstevamWim Van Sebroeck
authored andcommitted
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 <[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 076354a commit 90fc2c8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/watchdog/da9063_wdt.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ static int da9063_wdt_probe(struct platform_device *pdev)
263263
return devm_watchdog_register_device(dev, wdd);
264264
}
265265

266-
static int __maybe_unused da9063_wdt_suspend(struct device *dev)
266+
static int da9063_wdt_suspend(struct device *dev)
267267
{
268268
struct watchdog_device *wdd = dev_get_drvdata(dev);
269269
struct da9063 *da9063 = watchdog_get_drvdata(wdd);
@@ -277,7 +277,7 @@ static int __maybe_unused da9063_wdt_suspend(struct device *dev)
277277
return 0;
278278
}
279279

280-
static int __maybe_unused da9063_wdt_resume(struct device *dev)
280+
static int da9063_wdt_resume(struct device *dev)
281281
{
282282
struct watchdog_device *wdd = dev_get_drvdata(dev);
283283
struct da9063 *da9063 = watchdog_get_drvdata(wdd);
@@ -291,14 +291,14 @@ static int __maybe_unused da9063_wdt_resume(struct device *dev)
291291
return 0;
292292
}
293293

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);
296296

297297
static struct platform_driver da9063_wdt_driver = {
298298
.probe = da9063_wdt_probe,
299299
.driver = {
300300
.name = DA9063_DRVNAME_WATCHDOG,
301-
.pm = &da9063_wdt_pm_ops,
301+
.pm = pm_sleep_ptr(&da9063_wdt_pm_ops),
302302
},
303303
};
304304
module_platform_driver(da9063_wdt_driver);

0 commit comments

Comments
 (0)