From: Triet Hoang <triet.hoang.dev@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: myungjoo.ham@samsung.com, cw00.choi@samsung.com, wens@kernel.org,
hansg@kernel.org, Triet Hoang <triet.hoang.dev@gmail.com>
Subject: [PATCH] extcon: axp288: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
Date: Thu, 20 Aug 2026 15:22:24 +0700 [thread overview]
Message-ID: <20260820082224.2081888-1-triet.hoang.dev@gmail.com> (raw)
Convert the deprecated SIMPLE_DEV_PM_OPS
to DEFINE_SIMPLE_DEV_PM_OPS and pm_sleep_ptr().
This lets us drop the __maybe_unused annotations from the suspend and
resume callbacks, and reduces kernel size in case CONFIG_PM or
CONFIG_PM_SLEEP is disabled.
Signed-off-by: Triet Hoang <triet.hoang.dev@gmail.com>
---
drivers/extcon/extcon-axp288.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/extcon/extcon-axp288.c b/drivers/extcon/extcon-axp288.c
index 19856dddade6..f073aa3b52cb 100644
--- a/drivers/extcon/extcon-axp288.c
+++ b/drivers/extcon/extcon-axp288.c
@@ -476,7 +476,7 @@ static int axp288_extcon_probe(struct platform_device *pdev)
return 0;
}
-static int __maybe_unused axp288_extcon_suspend(struct device *dev)
+static int axp288_extcon_suspend(struct device *dev)
{
struct axp288_extcon_info *info = dev_get_drvdata(dev);
@@ -486,7 +486,7 @@ static int __maybe_unused axp288_extcon_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused axp288_extcon_resume(struct device *dev)
+static int axp288_extcon_resume(struct device *dev)
{
struct axp288_extcon_info *info = dev_get_drvdata(dev);
@@ -501,7 +501,7 @@ static int __maybe_unused axp288_extcon_resume(struct device *dev)
return 0;
}
-static SIMPLE_DEV_PM_OPS(axp288_extcon_pm_ops, axp288_extcon_suspend,
+static DEFINE_SIMPLE_DEV_PM_OPS(axp288_extcon_pm_ops, axp288_extcon_suspend,
axp288_extcon_resume);
static const struct platform_device_id axp288_extcon_table[] = {
@@ -515,7 +515,7 @@ static struct platform_driver axp288_extcon_driver = {
.id_table = axp288_extcon_table,
.driver = {
.name = "axp288_extcon",
- .pm = &axp288_extcon_pm_ops,
+ .pm = pm_sleep_ptr(&axp288_extcon_pm_ops),
},
};
module_platform_driver(axp288_extcon_driver);
--
2.53.0
next reply other threads:[~2026-08-20 8:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-20 8:22 Triet Hoang [this message]
2026-08-20 8:27 ` Hans de Goede
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=20260820082224.2081888-1-triet.hoang.dev@gmail.com \
--to=triet.hoang.dev@gmail.com \
--cc=cw00.choi@samsung.com \
--cc=hansg@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=myungjoo.ham@samsung.com \
--cc=wens@kernel.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
all inboxes | Powered by JetHome®