Skip to content

Commit

Permalink
dmaengine: pl330: remove pdata based initialization
Browse files Browse the repository at this point in the history
This driver is now used only on platforms which support device tree, so
it is safe to remove legacy platform data based initialization code.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
For plat-samsung:
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
  • Loading branch information
Marek Szyprowski authored and Vinod Koul committed Mar 28, 2017
1 parent c1ae3cf commit e8bb467
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 70 deletions.
1 change: 0 additions & 1 deletion arch/arm/plat-samsung/devs.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
* published by the Free Software Foundation.
*/

#include <linux/amba/pl330.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/interrupt.h>
Expand Down
42 changes: 8 additions & 34 deletions drivers/dma/pl330.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <linux/dma-mapping.h>
#include <linux/dmaengine.h>
#include <linux/amba/bus.h>
#include <linux/amba/pl330.h>
#include <linux/scatterlist.h>
#include <linux/of.h>
#include <linux/of_dma.h>
Expand Down Expand Up @@ -2077,18 +2076,6 @@ static void pl330_tasklet(unsigned long data)
}
}

bool pl330_filter(struct dma_chan *chan, void *param)
{
u8 *peri_id;

if (chan->device->dev->driver != &pl330_driver.drv)
return false;

peri_id = chan->private;
return *peri_id == (unsigned long)param;
}
EXPORT_SYMBOL(pl330_filter);

static struct dma_chan *of_dma_pl330_xlate(struct of_phandle_args *dma_spec,
struct of_dma *ofdma)
{
Expand Down Expand Up @@ -2833,7 +2820,6 @@ static SIMPLE_DEV_PM_OPS(pl330_pm, pl330_suspend, pl330_resume);
static int
pl330_probe(struct amba_device *adev, const struct amba_id *id)
{
struct dma_pl330_platdata *pdat;
struct pl330_config *pcfg;
struct pl330_dmac *pl330;
struct dma_pl330_chan *pch, *_p;
Expand All @@ -2843,8 +2829,6 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
int num_chan;
struct device_node *np = adev->dev.of_node;

pdat = dev_get_platdata(&adev->dev);

ret = dma_set_mask_and_coherent(&adev->dev, DMA_BIT_MASK(32));
if (ret)
return ret;
Expand All @@ -2857,7 +2841,7 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
pd = &pl330->ddma;
pd->dev = &adev->dev;

pl330->mcbufsz = pdat ? pdat->mcbuf_sz : 0;
pl330->mcbufsz = 0;

/* get quirk */
for (i = 0; i < ARRAY_SIZE(of_quirks); i++)
Expand Down Expand Up @@ -2901,10 +2885,7 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
INIT_LIST_HEAD(&pd->channels);

/* Initialize channel parameters */
if (pdat)
num_chan = max_t(int, pdat->nr_valid_peri, pcfg->num_chan);
else
num_chan = max_t(int, pcfg->num_peri, pcfg->num_chan);
num_chan = max_t(int, pcfg->num_peri, pcfg->num_chan);

pl330->num_peripherals = num_chan;

Expand All @@ -2916,11 +2897,8 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)

for (i = 0; i < num_chan; i++) {
pch = &pl330->peripherals[i];
if (!adev->dev.of_node)
pch->chan.private = pdat ? &pdat->peri_id[i] : NULL;
else
pch->chan.private = adev->dev.of_node;

pch->chan.private = adev->dev.of_node;
INIT_LIST_HEAD(&pch->submitted_list);
INIT_LIST_HEAD(&pch->work_list);
INIT_LIST_HEAD(&pch->completed_list);
Expand All @@ -2933,15 +2911,11 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
list_add_tail(&pch->chan.device_node, &pd->channels);
}

if (pdat) {
pd->cap_mask = pdat->cap_mask;
} else {
dma_cap_set(DMA_MEMCPY, pd->cap_mask);
if (pcfg->num_peri) {
dma_cap_set(DMA_SLAVE, pd->cap_mask);
dma_cap_set(DMA_CYCLIC, pd->cap_mask);
dma_cap_set(DMA_PRIVATE, pd->cap_mask);
}
dma_cap_set(DMA_MEMCPY, pd->cap_mask);
if (pcfg->num_peri) {
dma_cap_set(DMA_SLAVE, pd->cap_mask);
dma_cap_set(DMA_CYCLIC, pd->cap_mask);
dma_cap_set(DMA_PRIVATE, pd->cap_mask);
}

pd->device_alloc_chan_resources = pl330_alloc_chan_resources;
Expand Down
35 changes: 0 additions & 35 deletions include/linux/amba/pl330.h

This file was deleted.

0 comments on commit e8bb467

Please sign in to comment.