The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] ACPI: SBS: use DEFINE_SIMPLE_DEV_PM_OPS
@ 2026-08-20  3:48 Triet Hoang
  0 siblings, 0 replies; only message in thread
From: Triet Hoang @ 2026-08-20  3:48 UTC (permalink / raw)
  To: rafael; +Cc: lenb, linux-acpi, linux-kernel, Triet Hoang

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/sbs.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c
index 86b7c7975852..543ca5f0defa 100644
--- a/drivers/acpi/sbs.c
+++ b/drivers/acpi/sbs.c
@@ -692,17 +692,13 @@ static void acpi_sbs_remove(struct platform_device *pdev)
 	kfree(sbs);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int acpi_sbs_resume(struct device *dev)
 {
 	acpi_sbs_callback(dev_get_drvdata(dev));
 	return 0;
 }
-#else
-#define acpi_sbs_resume NULL
-#endif
 
-static SIMPLE_DEV_PM_OPS(acpi_sbs_pm, NULL, acpi_sbs_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(acpi_sbs_pm, NULL, acpi_sbs_resume);
 
 static struct platform_driver acpi_sbs_driver = {
 	.probe = acpi_sbs_probe,
@@ -710,7 +706,7 @@ static struct platform_driver acpi_sbs_driver = {
 	.driver = {
 		.name = "acpi-sbs",
 		.acpi_match_table = sbs_device_ids,
-		.pm = &acpi_sbs_pm,
+		.pm = pm_sleep_ptr(&acpi_sbs_pm),
 	},
 };
 
-- 
2.53.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-20  3:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-20  3:48 [PATCH] ACPI: SBS: use DEFINE_SIMPLE_DEV_PM_OPS Triet Hoang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox