Skip to content

Commit 1e137d5

Browse files
andy-shevvinodkoul
authored andcommitted
dmaengine: dw: Switch to LATE_SIMPLE_DEV_PM_OPS()
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>
1 parent 91d8560 commit 1e137d5

2 files changed

Lines changed: 4 additions & 12 deletions

File tree

drivers/dma/dw/pci.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ static void dw_pci_remove(struct pci_dev *pdev)
7676
dev_warn(&pdev->dev, "can't remove device properly: %d\n", ret);
7777
}
7878

79-
#ifdef CONFIG_PM_SLEEP
80-
8179
static int dw_pci_suspend_late(struct device *dev)
8280
{
8381
struct dw_dma_chip_pdata *data = dev_get_drvdata(dev);
@@ -94,10 +92,8 @@ static int dw_pci_resume_early(struct device *dev)
9492
return do_dw_dma_enable(chip);
9593
};
9694

97-
#endif /* CONFIG_PM_SLEEP */
98-
9995
static const struct dev_pm_ops dw_pci_dev_pm_ops = {
100-
SET_LATE_SYSTEM_SLEEP_PM_OPS(dw_pci_suspend_late, dw_pci_resume_early)
96+
LATE_SYSTEM_SLEEP_PM_OPS(dw_pci_suspend_late, dw_pci_resume_early)
10197
};
10298

10399
static const struct pci_device_id dw_pci_id_table[] = {
@@ -136,7 +132,7 @@ static struct pci_driver dw_pci_driver = {
136132
.probe = dw_pci_probe,
137133
.remove = dw_pci_remove,
138134
.driver = {
139-
.pm = &dw_pci_dev_pm_ops,
135+
.pm = pm_sleep_ptr(&dw_pci_dev_pm_ops),
140136
},
141137
};
142138

drivers/dma/dw/platform.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,6 @@ static const struct acpi_device_id dw_dma_acpi_id_table[] = {
157157
MODULE_DEVICE_TABLE(acpi, dw_dma_acpi_id_table);
158158
#endif
159159

160-
#ifdef CONFIG_PM_SLEEP
161-
162160
static int dw_suspend_late(struct device *dev)
163161
{
164162
struct dw_dma_chip_pdata *data = dev_get_drvdata(dev);
@@ -183,10 +181,8 @@ static int dw_resume_early(struct device *dev)
183181
return do_dw_dma_enable(chip);
184182
}
185183

186-
#endif /* CONFIG_PM_SLEEP */
187-
188184
static const struct dev_pm_ops dw_dev_pm_ops = {
189-
SET_LATE_SYSTEM_SLEEP_PM_OPS(dw_suspend_late, dw_resume_early)
185+
LATE_SYSTEM_SLEEP_PM_OPS(dw_suspend_late, dw_resume_early)
190186
};
191187

192188
static struct platform_driver dw_driver = {
@@ -195,7 +191,7 @@ static struct platform_driver dw_driver = {
195191
.shutdown = dw_shutdown,
196192
.driver = {
197193
.name = DRV_NAME,
198-
.pm = &dw_dev_pm_ops,
194+
.pm = pm_sleep_ptr(&dw_dev_pm_ops),
199195
.of_match_table = of_match_ptr(dw_dma_of_id_table),
200196
.acpi_match_table = ACPI_PTR(dw_dma_acpi_id_table),
201197
},

0 commit comments

Comments
 (0)