From: Triet Hoang <triet.hoang.dev@gmail.com>
To: rafael@kernel.org
Cc: lenb@kernel.org, linux-acpi@vger.kernel.org,
linux-kernel@vger.kernel.org, triet.hoang.dev@gmail.com
Subject: [PATCH] ACPI: AC: use DEFINE_SIMPLE_DEV_PM_OPS
Date: Thu, 20 Aug 2026 10:12:53 +0700 [thread overview]
Message-ID: <20260820031253.1636952-1-triet.hoang.dev@gmail.com> (raw)
Convert the deprecated SIMPLE_DEV_PM_OPS
to DEFINE_SIMPLE_DEV_PM_OPS
Also use pm_sleep_ptr() when assigning the ops to the driver.
This allows the removal of the ifdef CONFIG_PM_SLEEP.
Signed-off-by: Triet Hoang <triet.hoang.dev@gmail.com>
---
drivers/acpi/ac.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
index f19d6dd43473..eef0c8e32d73 100644
--- a/drivers/acpi/ac.c
+++ b/drivers/acpi/ac.c
@@ -239,7 +239,6 @@ static int acpi_ac_probe(struct platform_device *pdev)
return 0;
}
-#ifdef CONFIG_PM_SLEEP
static int acpi_ac_resume(struct device *dev)
{
struct acpi_ac *ac = dev_get_drvdata(dev);
@@ -253,9 +252,8 @@ static int acpi_ac_resume(struct device *dev)
return 0;
}
-#endif
-static SIMPLE_DEV_PM_OPS(acpi_ac_pm, NULL, acpi_ac_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(acpi_ac_pm, NULL, acpi_ac_resume);
static void acpi_ac_remove(struct platform_device *pdev)
{
@@ -270,7 +268,7 @@ static struct platform_driver acpi_ac_driver = {
.driver = {
.name = "ac",
.acpi_match_table = ac_device_ids,
- .pm = &acpi_ac_pm,
+ .pm = pm_sleep_ptr(&acpi_ac_pm),
},
};
--
2.53.0
reply other threads:[~2026-08-20 3:12 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260820031253.1636952-1-triet.hoang.dev@gmail.com \
--to=triet.hoang.dev@gmail.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@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