diff mbox series

[RFC,06/14] ahci: mtk: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()

Message ID 20250127-pm_ata-v1-6-f8f50c821a2a@gmail.com (mailing list archive)
State New
Headers show
Series AHCI power management cleanup | expand

Commit Message

Raphael Gallais-Pou Jan. 27, 2025, 12:46 p.m. UTC
Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of #ifdef based kernel configuration guards.

Signed-off-by: Raphael Gallais-Pou <rgallaispou@gmail.com>
---
 drivers/ata/ahci_mtk.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/ata/ahci_mtk.c b/drivers/ata/ahci_mtk.c
index 7295b9066ae213a72a8c180a66ecfac8c2f46ff9..4afcf5e90e3b660f17b2eb0b1e3df446bef470da 100644
--- a/drivers/ata/ahci_mtk.c
+++ b/drivers/ata/ahci_mtk.c
@@ -163,8 +163,9 @@  static int mtk_ahci_probe(struct platform_device *pdev)
 	return err;
 }
 
-static SIMPLE_DEV_PM_OPS(ahci_pm_ops, ahci_platform_suspend,
-			 ahci_platform_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(ahci_pm_ops,
+				ahci_platform_suspend,
+				ahci_platform_resume);
 
 static const struct of_device_id ahci_of_match[] = {
 	{ .compatible = "mediatek,mtk-ahci", },
@@ -178,7 +179,7 @@  static struct platform_driver mtk_ahci_driver = {
 	.driver = {
 		.name = DRV_NAME,
 		.of_match_table = ahci_of_match,
-		.pm = &ahci_pm_ops,
+		.pm = pm_sleep_ptr(&ahci_pm_ops),
 	},
 };
 module_platform_driver(mtk_ahci_driver);