From: Fabio Estevam <festevam@gmail.com>
To: wim@linux-watchdog.org
Cc: linux@roeck-us.net, support.opensource@diasemi.com,
linux-watchdog@vger.kernel.org, Fabio Estevam <festevam@denx.de>
Subject: [PATCH v2 2/2] watchdog: da9063: Remove __maybe_unused notations
Date: Fri, 18 Oct 2024 10:58:21 -0300 [thread overview]
Message-ID: <20241018135821.274376-2-festevam@gmail.com> (raw)
In-Reply-To: <20241018135821.274376-1-festevam@gmail.com>
From: Fabio Estevam <festevam@denx.de>
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>
---
Changes since v1:
- Newly introduced.
drivers/watchdog/da9063_wdt.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/watchdog/da9063_wdt.c b/drivers/watchdog/da9063_wdt.c
index 69f884cf1a7b..92e1b78ff481 100644
--- a/drivers/watchdog/da9063_wdt.c
+++ b/drivers/watchdog/da9063_wdt.c
@@ -263,7 +263,7 @@ static int da9063_wdt_probe(struct platform_device *pdev)
return devm_watchdog_register_device(dev, wdd);
}
-static int __maybe_unused da9063_wdt_suspend(struct device *dev)
+static int da9063_wdt_suspend(struct device *dev)
{
struct watchdog_device *wdd = dev_get_drvdata(dev);
struct da9063 *da9063 = watchdog_get_drvdata(wdd);
@@ -277,7 +277,7 @@ static int __maybe_unused da9063_wdt_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused da9063_wdt_resume(struct device *dev)
+static int da9063_wdt_resume(struct device *dev)
{
struct watchdog_device *wdd = dev_get_drvdata(dev);
struct da9063 *da9063 = watchdog_get_drvdata(wdd);
@@ -291,14 +291,14 @@ static int __maybe_unused da9063_wdt_resume(struct device *dev)
return 0;
}
-static SIMPLE_DEV_PM_OPS(da9063_wdt_pm_ops,
- da9063_wdt_suspend, da9063_wdt_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(da9063_wdt_pm_ops, da9063_wdt_suspend,
+ da9063_wdt_resume);
static struct platform_driver da9063_wdt_driver = {
.probe = da9063_wdt_probe,
.driver = {
.name = DA9063_DRVNAME_WATCHDOG,
- .pm = &da9063_wdt_pm_ops,
+ .pm = pm_sleep_ptr(&da9063_wdt_pm_ops),
},
};
module_platform_driver(da9063_wdt_driver);
--
2.34.1
next prev parent reply other threads:[~2024-10-18 13:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-18 13:58 [PATCH v2 1/2] watchdog: da9063: Do not use a global variable Fabio Estevam
2024-10-18 13:58 ` Fabio Estevam [this message]
2024-10-18 14:19 ` [PATCH v2 2/2] watchdog: da9063: Remove __maybe_unused notations Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241018135821.274376-2-festevam@gmail.com \
--to=festevam@gmail.com \
--cc=festevam@denx.de \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=support.opensource@diasemi.com \
--cc=wim@linux-watchdog.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox