Skip to content

Commit c3c328d

Browse files
geertuvinodkoul
authored andcommitted
dmaengine: rcar-dmac: Convert to NOIRQ_SYSTEM_SLEEP/RUNTIME_PM_OPS()
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>
1 parent b78c628 commit c3c328d

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

drivers/dma/sh/rcar-dmac.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1728,24 +1728,22 @@ static struct dma_chan *rcar_dmac_of_xlate(struct of_phandle_args *dma_spec,
17281728
* Power management
17291729
*/
17301730

1731-
#ifdef CONFIG_PM
17321731
static int rcar_dmac_runtime_resume(struct device *dev)
17331732
{
17341733
struct rcar_dmac *dmac = dev_get_drvdata(dev);
17351734

17361735
return rcar_dmac_init(dmac);
17371736
}
1738-
#endif
17391737

17401738
static const struct dev_pm_ops rcar_dmac_pm = {
17411739
/*
17421740
* TODO for system sleep/resume:
17431741
* - Wait for the current transfer to complete and stop the device,
17441742
* - Resume transfers, if any.
17451743
*/
1746-
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
1747-
pm_runtime_force_resume)
1748-
SET_RUNTIME_PM_OPS(NULL, rcar_dmac_runtime_resume, NULL)
1744+
NOIRQ_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
1745+
pm_runtime_force_resume)
1746+
RUNTIME_PM_OPS(NULL, rcar_dmac_runtime_resume, NULL)
17491747
};
17501748

17511749
/* -----------------------------------------------------------------------------
@@ -2030,7 +2028,7 @@ MODULE_DEVICE_TABLE(of, rcar_dmac_of_ids);
20302028

20312029
static struct platform_driver rcar_dmac_driver = {
20322030
.driver = {
2033-
.pm = &rcar_dmac_pm,
2031+
.pm = pm_ptr(&rcar_dmac_pm),
20342032
.name = "rcar-dmac",
20352033
.of_match_table = rcar_dmac_of_ids,
20362034
},

0 commit comments

Comments
 (0)