]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
dmaengine: sh: usb-dmac: Convert to NOIRQ_SYSTEM_SLEEP/RUNTIME_PM_OPS()
authorGeert Uytterhoeven <geert+renesas@glider.be>
Thu, 4 Sep 2025 15:30:08 +0000 (17:30 +0200)
committerVinod Koul <vkoul@kernel.org>
Thu, 16 Oct 2025 12:11:45 +0000 (17:41 +0530)
Convert the Renesas USB-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/usb-dmac.c

index 7e2b6c97fa2f97f2d3dfe323f684f65278f012ee..b42e5a66fd95759edecd160ac2869ced2b783dd9 100644 (file)
@@ -670,7 +670,6 @@ static struct dma_chan *usb_dmac_of_xlate(struct of_phandle_args *dma_spec,
  * Power management
  */
 
-#ifdef CONFIG_PM
 static int usb_dmac_runtime_suspend(struct device *dev)
 {
        struct usb_dmac *dmac = dev_get_drvdata(dev);
@@ -691,13 +690,11 @@ static int usb_dmac_runtime_resume(struct device *dev)
 
        return usb_dmac_init(dmac);
 }
-#endif /* CONFIG_PM */
 
 static const struct dev_pm_ops usb_dmac_pm = {
-       SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
-                                     pm_runtime_force_resume)
-       SET_RUNTIME_PM_OPS(usb_dmac_runtime_suspend, usb_dmac_runtime_resume,
-                          NULL)
+       NOIRQ_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
+                                 pm_runtime_force_resume)
+       RUNTIME_PM_OPS(usb_dmac_runtime_suspend, usb_dmac_runtime_resume, NULL)
 };
 
 /* -----------------------------------------------------------------------------
@@ -894,7 +891,7 @@ MODULE_DEVICE_TABLE(of, usb_dmac_of_ids);
 
 static struct platform_driver usb_dmac_driver = {
        .driver         = {
-               .pm     = &usb_dmac_pm,
+               .pm     = pm_ptr(&usb_dmac_pm),
                .name   = "usb-dmac",
                .of_match_table = usb_dmac_of_ids,
        },