dmaengine: dw: Switch to LATE_SIMPLE_DEV_PM_OPS()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 5 Feb 2025 15:06:48 +0000 (17:06 +0200)
committerVinod Koul <vkoul@kernel.org>
Mon, 10 Feb 2025 10:59:11 +0000 (16:29 +0530)
SET_LATE_SYSTEM_SLEEP_PM_OPS is deprecated, replace it with
LATE_SYSTEM_SLEEP_PM_OPS() and use pm_sleep_ptr() for setting
the driver's pm routines. We can now remove the ifdeffery
in the suspend and resume functions.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Serge Semin <fancer.lancer@gmail.com>
Link: https://lore.kernel.org/r/20250205150701.893083-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/dw/pci.c
drivers/dma/dw/platform.c

index e8a0eb81726a5655363445bfff00a0774374810a..a3aae3d1c093c6da03d947c07187b228aae0c0d7 100644 (file)
@@ -76,8 +76,6 @@ static void dw_pci_remove(struct pci_dev *pdev)
                dev_warn(&pdev->dev, "can't remove device properly: %d\n", ret);
 }
 
-#ifdef CONFIG_PM_SLEEP
-
 static int dw_pci_suspend_late(struct device *dev)
 {
        struct dw_dma_chip_pdata *data = dev_get_drvdata(dev);
@@ -94,10 +92,8 @@ static int dw_pci_resume_early(struct device *dev)
        return do_dw_dma_enable(chip);
 };
 
-#endif /* CONFIG_PM_SLEEP */
-
 static const struct dev_pm_ops dw_pci_dev_pm_ops = {
-       SET_LATE_SYSTEM_SLEEP_PM_OPS(dw_pci_suspend_late, dw_pci_resume_early)
+       LATE_SYSTEM_SLEEP_PM_OPS(dw_pci_suspend_late, dw_pci_resume_early)
 };
 
 static const struct pci_device_id dw_pci_id_table[] = {
@@ -136,7 +132,7 @@ static struct pci_driver dw_pci_driver = {
        .probe          = dw_pci_probe,
        .remove         = dw_pci_remove,
        .driver = {
-               .pm     = &dw_pci_dev_pm_ops,
+               .pm     = pm_sleep_ptr(&dw_pci_dev_pm_ops),
        },
 };
 
index 2606cf9cd4299480e848e9416ca1ef60053c9d54..cee56cd31a611c458534e4cb6e958bfb1e7a6948 100644 (file)
@@ -157,8 +157,6 @@ static const struct acpi_device_id dw_dma_acpi_id_table[] = {
 MODULE_DEVICE_TABLE(acpi, dw_dma_acpi_id_table);
 #endif
 
-#ifdef CONFIG_PM_SLEEP
-
 static int dw_suspend_late(struct device *dev)
 {
        struct dw_dma_chip_pdata *data = dev_get_drvdata(dev);
@@ -183,10 +181,8 @@ static int dw_resume_early(struct device *dev)
        return do_dw_dma_enable(chip);
 }
 
-#endif /* CONFIG_PM_SLEEP */
-
 static const struct dev_pm_ops dw_dev_pm_ops = {
-       SET_LATE_SYSTEM_SLEEP_PM_OPS(dw_suspend_late, dw_resume_early)
+       LATE_SYSTEM_SLEEP_PM_OPS(dw_suspend_late, dw_resume_early)
 };
 
 static struct platform_driver dw_driver = {
@@ -195,7 +191,7 @@ static struct platform_driver dw_driver = {
        .shutdown       = dw_shutdown,
        .driver = {
                .name   = DRV_NAME,
-               .pm     = &dw_dev_pm_ops,
+               .pm     = pm_sleep_ptr(&dw_dev_pm_ops),
                .of_match_table = of_match_ptr(dw_dma_of_id_table),
                .acpi_match_table = ACPI_PTR(dw_dma_acpi_id_table),
        },