dmaengine: dw: balance PM runtime calls
In case of PCI driver we will get a warning:
dw_dmac_pci 0000:00:18.0: Unbalanced pm_runtime_enable!
dw_dmac_pci 0000:00:18.0: DesignWare DMA Controller, 8 channels
This happens due to pm_runtime_enable() call from the driver when PM runtime is
enabled by core.
This patch moves that call to the platform driver where it might make sense.
Fixes: bb32baf76e
(dmaengine: dw: enable runtime PM)
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
This commit is contained in:
parent
0ce3c066c4
commit
6acf3998d2
2 changed files with 5 additions and 2 deletions
|
@ -1505,7 +1505,6 @@ int dw_dma_probe(struct dw_dma_chip *chip, struct dw_dma_platform_data *pdata)
|
|||
dw->regs = chip->regs;
|
||||
chip->dw = dw;
|
||||
|
||||
pm_runtime_enable(chip->dev);
|
||||
pm_runtime_get_sync(chip->dev);
|
||||
|
||||
dw_params = dma_read_byaddr(chip->regs, DW_PARAMS);
|
||||
|
@ -1703,7 +1702,6 @@ int dw_dma_remove(struct dw_dma_chip *chip)
|
|||
}
|
||||
|
||||
pm_runtime_put_sync_suspend(chip->dev);
|
||||
pm_runtime_disable(chip->dev);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(dw_dma_remove);
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include <linux/module.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/dmaengine.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
|
@ -185,6 +186,8 @@ static int dw_probe(struct platform_device *pdev)
|
|||
if (err)
|
||||
return err;
|
||||
|
||||
pm_runtime_enable(&pdev->dev);
|
||||
|
||||
err = dw_dma_probe(chip, pdata);
|
||||
if (err)
|
||||
goto err_dw_dma_probe;
|
||||
|
@ -205,6 +208,7 @@ static int dw_probe(struct platform_device *pdev)
|
|||
return 0;
|
||||
|
||||
err_dw_dma_probe:
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
clk_disable_unprepare(chip->clk);
|
||||
return err;
|
||||
}
|
||||
|
@ -217,6 +221,7 @@ static int dw_remove(struct platform_device *pdev)
|
|||
of_dma_controller_free(pdev->dev.of_node);
|
||||
|
||||
dw_dma_remove(chip);
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
clk_disable_unprepare(chip->clk);
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue