Skip to content

Commit

Permalink
DMA: PL330: Remove redundant runtime_suspend/resume functions
Browse files Browse the repository at this point in the history
The driver's  runtime_suspend/resume functions just disable/enable
the clock which is already being managed at AMBA bus level
runtime_suspend/resume functions.

Hence, remove the driver's runtime_suspend/resume functions.

Signed-off-by: Inderpal Singh <inderpal.singh@linaro.org>
Tested-by: Chander Kashyap <chander.kashyap@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
  • Loading branch information
Inderpal Singh authored and Vinod Koul committed Sep 18, 2012
1 parent faf6fbc commit 7c71b8e
Showing 1 changed file with 5 additions and 56 deletions.
61 changes: 5 additions & 56 deletions drivers/dma/pl330.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include <linux/dmaengine.h>
#include <linux/amba/bus.h>
#include <linux/amba/pl330.h>
#include <linux/pm_runtime.h>
#include <linux/scatterlist.h>
#include <linux/of.h>

Expand Down Expand Up @@ -586,8 +585,6 @@ struct dma_pl330_dmac {

/* Peripheral channels connected to this DMAC */
struct dma_pl330_chan *peripherals; /* keep at end */

struct clk *clk;
};

struct dma_pl330_desc {
Expand Down Expand Up @@ -2887,24 +2884,17 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
goto probe_err1;
}

pdmac->clk = clk_get(&adev->dev, "dma");
if (IS_ERR(pdmac->clk)) {
dev_err(&adev->dev, "Cannot get operation clock.\n");
ret = -EINVAL;
goto probe_err2;
}

amba_set_drvdata(adev, pdmac);

irq = adev->irq[0];
ret = request_irq(irq, pl330_irq_handler, 0,
dev_name(&adev->dev), pi);
if (ret)
goto probe_err3;
goto probe_err2;

ret = pl330_add(pi);
if (ret)
goto probe_err4;
goto probe_err3;

INIT_LIST_HEAD(&pdmac->desc_pool);
spin_lock_init(&pdmac->pool_lock);
Expand Down Expand Up @@ -2965,7 +2955,7 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
ret = dma_async_device_register(pd);
if (ret) {
dev_err(&adev->dev, "unable to register DMAC\n");
goto probe_err5;
goto probe_err4;
}

dev_info(&adev->dev,
Expand All @@ -2978,12 +2968,10 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)

return 0;

probe_err5:
pl330_del(pi);
probe_err4:
free_irq(irq, pi);
pl330_del(pi);
probe_err3:
clk_put(pdmac->clk);
free_irq(irq, pi);
probe_err2:
iounmap(pi->base);
probe_err1:
Expand Down Expand Up @@ -3045,49 +3033,10 @@ static struct amba_id pl330_ids[] = {

MODULE_DEVICE_TABLE(amba, pl330_ids);

#ifdef CONFIG_PM_RUNTIME
static int pl330_runtime_suspend(struct device *dev)
{
struct dma_pl330_dmac *pdmac = dev_get_drvdata(dev);

if (!pdmac) {
dev_err(dev, "failed to get dmac\n");
return -ENODEV;
}

clk_disable(pdmac->clk);

return 0;
}

static int pl330_runtime_resume(struct device *dev)
{
struct dma_pl330_dmac *pdmac = dev_get_drvdata(dev);

if (!pdmac) {
dev_err(dev, "failed to get dmac\n");
return -ENODEV;
}

clk_enable(pdmac->clk);

return 0;
}
#else
#define pl330_runtime_suspend NULL
#define pl330_runtime_resume NULL
#endif /* CONFIG_PM_RUNTIME */

static const struct dev_pm_ops pl330_pm_ops = {
.runtime_suspend = pl330_runtime_suspend,
.runtime_resume = pl330_runtime_resume,
};

static struct amba_driver pl330_driver = {
.drv = {
.owner = THIS_MODULE,
.name = "dma-pl330",
.pm = &pl330_pm_ops,
},
.id_table = pl330_ids,
.probe = pl330_probe,
Expand Down

0 comments on commit 7c71b8e

Please sign in to comment.