]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
dmaengine: rcar-dmac: Convert to NOIRQ_SYSTEM_SLEEP/RUNTIME_PM_OPS()
authorGeert Uytterhoeven <geert+renesas@glider.be>
Thu, 4 Sep 2025 15:25:10 +0000 (17:25 +0200)
committerVinod Koul <vkoul@kernel.org>
Thu, 16 Oct 2025 12:12:01 +0000 (17:42 +0530)
Convert the Renesas R-Car DMA Controller driver from
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS() and SET_RUNTIME_PM_OPS() to
NOIRQ_SYSTEM_SLEEP_PM_OPS(), RUNTIME_PM_OPS(), and pm_ptr().  This lets
us drop the check for CONFIG_PM, and reduces kernel size in case
CONFIG_PM is disabled, while increasing build coverage.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/sh/rcar-dmac.c

index 0b8fb830ce8ce66a5da5bdb0730a8316a75c41a4..475a347cae1b6aaa24e60d18ecc1f15f215c6c11 100644 (file)
@@ -1728,14 +1728,12 @@ static struct dma_chan *rcar_dmac_of_xlate(struct of_phandle_args *dma_spec,
  * Power management
  */
 
-#ifdef CONFIG_PM
 static int rcar_dmac_runtime_resume(struct device *dev)
 {
        struct rcar_dmac *dmac = dev_get_drvdata(dev);
 
        return rcar_dmac_init(dmac);
 }
-#endif
 
 static const struct dev_pm_ops rcar_dmac_pm = {
        /*
@@ -1743,9 +1741,9 @@ static const struct dev_pm_ops rcar_dmac_pm = {
         *   - Wait for the current transfer to complete and stop the device,
         *   - Resume transfers, if any.
         */
-       SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
-                                     pm_runtime_force_resume)
-       SET_RUNTIME_PM_OPS(NULL, rcar_dmac_runtime_resume, NULL)
+       NOIRQ_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
+                                 pm_runtime_force_resume)
+       RUNTIME_PM_OPS(NULL, rcar_dmac_runtime_resume, NULL)
 };
 
 /* -----------------------------------------------------------------------------
@@ -2030,7 +2028,7 @@ MODULE_DEVICE_TABLE(of, rcar_dmac_of_ids);
 
 static struct platform_driver rcar_dmac_driver = {
        .driver         = {
-               .pm     = &rcar_dmac_pm,
+               .pm     = pm_ptr(&rcar_dmac_pm),
                .name   = "rcar-dmac",
                .of_match_table = rcar_dmac_of_ids,
        },