Skip to content

Commit b46d155

Browse files
geertuvinodkoul
authored andcommitted
dmaengine: sh: usb-dmac: Convert to NOIRQ_SYSTEM_SLEEP/RUNTIME_PM_OPS()
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>
1 parent 3a86608 commit b46d155

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

drivers/dma/sh/usb-dmac.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,6 @@ static struct dma_chan *usb_dmac_of_xlate(struct of_phandle_args *dma_spec,
670670
* Power management
671671
*/
672672

673-
#ifdef CONFIG_PM
674673
static int usb_dmac_runtime_suspend(struct device *dev)
675674
{
676675
struct usb_dmac *dmac = dev_get_drvdata(dev);
@@ -691,13 +690,11 @@ static int usb_dmac_runtime_resume(struct device *dev)
691690

692691
return usb_dmac_init(dmac);
693692
}
694-
#endif /* CONFIG_PM */
695693

696694
static const struct dev_pm_ops usb_dmac_pm = {
697-
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
698-
pm_runtime_force_resume)
699-
SET_RUNTIME_PM_OPS(usb_dmac_runtime_suspend, usb_dmac_runtime_resume,
700-
NULL)
695+
NOIRQ_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
696+
pm_runtime_force_resume)
697+
RUNTIME_PM_OPS(usb_dmac_runtime_suspend, usb_dmac_runtime_resume, NULL)
701698
};
702699

703700
/* -----------------------------------------------------------------------------
@@ -894,7 +891,7 @@ MODULE_DEVICE_TABLE(of, usb_dmac_of_ids);
894891

895892
static struct platform_driver usb_dmac_driver = {
896893
.driver = {
897-
.pm = &usb_dmac_pm,
894+
.pm = pm_ptr(&usb_dmac_pm),
898895
.name = "usb-dmac",
899896
.of_match_table = usb_dmac_of_ids,
900897
},

0 commit comments

Comments
 (0)