[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250826103017.1891990-2-a.shimko@yadro.com>
Date: Tue, 26 Aug 2025 13:30:15 +0300
From: Artem Shimko <artyom.shimko@...il.com>
To: dmaengine@...r.kernel.org
Cc: Artem Shimko <artyom.shimko@...il.com>,
linux-kernel@...r.kernel.org,
vkoul@...nel.org,
eugeniy.paltsev@...opsys.com
Subject: [PATCH 1/1] drivers: dma: change pm registration for dw-axi-dmac-platform's suspend
From: Artem Shimko <artyom.shimko@...il.com>
Replaced the deprecated SET_RUNTIME_PM_OPS macro with the
DEFINE_RUNTIME_DEV_PM_OPS macro for defining device power
management operations.
The DEFINE_RUNTIME_DEV_PM_OPS macro provides the same functionality
to support system suspend mode.
Signed-off-by: Artem Shimko <artyom.shimko@...il.com>
---
.../dma/dw-axi-dmac/dw-axi-dmac-platform.c | 31 ++++++-------------
1 file changed, 9 insertions(+), 22 deletions(-)
diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
index c8eaa9c14c03..eeba28a1d2c8 100644
--- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
+++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
@@ -1400,8 +1400,10 @@ static int dma_chan_resume(struct dma_chan *dchan)
return 0;
}
-static int axi_dma_suspend(struct axi_dma_chip *chip)
+static int __maybe_unused axi_dma_suspend(struct device *dev)
{
+ struct axi_dma_chip *chip = dev_get_drvdata(dev);
+
axi_dma_irq_disable(chip);
axi_dma_disable(chip);
@@ -1411,9 +1413,10 @@ static int axi_dma_suspend(struct axi_dma_chip *chip)
return 0;
}
-static int axi_dma_resume(struct axi_dma_chip *chip)
+static int __maybe_unused axi_dma_resume(struct device *dev)
{
int ret;
+ struct axi_dma_chip *chip = dev_get_drvdata(dev);
ret = clk_prepare_enable(chip->cfgr_clk);
if (ret < 0)
@@ -1429,20 +1432,6 @@ static int axi_dma_resume(struct axi_dma_chip *chip)
return 0;
}
-static int __maybe_unused axi_dma_runtime_suspend(struct device *dev)
-{
- struct axi_dma_chip *chip = dev_get_drvdata(dev);
-
- return axi_dma_suspend(chip);
-}
-
-static int __maybe_unused axi_dma_runtime_resume(struct device *dev)
-{
- struct axi_dma_chip *chip = dev_get_drvdata(dev);
-
- return axi_dma_resume(chip);
-}
-
static struct dma_chan *dw_axi_dma_of_xlate(struct of_phandle_args *dma_spec,
struct of_dma *ofdma)
{
@@ -1676,7 +1665,7 @@ static int dw_probe(struct platform_device *pdev)
* driver to work also without Runtime PM.
*/
pm_runtime_get_noresume(chip->dev);
- ret = axi_dma_resume(chip);
+ ret = axi_dma_resume(chip->dev);
if (ret < 0)
goto err_pm_disable;
@@ -1724,7 +1713,7 @@ static void dw_remove(struct platform_device *pdev)
axi_dma_disable(chip);
pm_runtime_disable(chip->dev);
- axi_dma_suspend(chip);
+ axi_dma_suspend(chip->dev);
for (i = 0; i < DMAC_MAX_CHANNELS; i++)
if (chip->irq[i] > 0)
@@ -1739,9 +1728,7 @@ static void dw_remove(struct platform_device *pdev)
}
}
-static const struct dev_pm_ops dw_axi_dma_pm_ops = {
- SET_RUNTIME_PM_OPS(axi_dma_runtime_suspend, axi_dma_runtime_resume, NULL)
-};
+static DEFINE_RUNTIME_DEV_PM_OPS(dw_axi_dma_pm_ops, axi_dma_suspend, axi_dma_resume, NULL);
static const struct of_device_id dw_dma_of_id_table[] = {
{
@@ -1766,7 +1753,7 @@ static struct platform_driver dw_driver = {
.driver = {
.name = KBUILD_MODNAME,
.of_match_table = dw_dma_of_id_table,
- .pm = &dw_axi_dma_pm_ops,
+ .pm = pm_ptr(&dw_axi_dma_pm_ops),
},
};
module_platform_driver(dw_driver);
--
2.43.0
Powered by blists - more mailing lists