Skip to content

Commit

Permalink
DMA-API: amba: get rid of separate dma_mask
Browse files Browse the repository at this point in the history
AMBA Primecell devices always treat streaming and coherent DMA exactly
the same, so there's no point in having the masks separated.

Acked-by: Grant Likely <[email protected]>
Signed-off-by: Russell King <[email protected]>
  • Loading branch information
Russell King committed Oct 31, 2013
1 parent 01edb5e commit 446b2a9
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 10 deletions.
6 changes: 1 addition & 5 deletions drivers/amba/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,6 @@ amba_aphb_device_add(struct device *parent, const char *name,
if (!dev)
return ERR_PTR(-ENOMEM);

dev->dma_mask = dma_mask;
dev->dev.coherent_dma_mask = dma_mask;
dev->irq[0] = irq1;
dev->irq[1] = irq2;
Expand Down Expand Up @@ -619,7 +618,7 @@ static void amba_device_initialize(struct amba_device *dev, const char *name)
dev_set_name(&dev->dev, "%s", name);
dev->dev.release = amba_device_release;
dev->dev.bus = &amba_bustype;
dev->dev.dma_mask = &dev->dma_mask;
dev->dev.dma_mask = &dev->dev.coherent_dma_mask;
dev->res.name = dev_name(&dev->dev);
}

Expand Down Expand Up @@ -663,9 +662,6 @@ int amba_device_register(struct amba_device *dev, struct resource *parent)
amba_device_initialize(dev, dev->dev.init_name);
dev->dev.init_name = NULL;

if (!dev->dev.coherent_dma_mask && dev->dma_mask)
dev_warn(&dev->dev, "coherent dma mask is unset\n");

return amba_device_add(dev, parent);
}

Expand Down
3 changes: 0 additions & 3 deletions drivers/of/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,6 @@ static struct amba_device *of_amba_device_create(struct device_node *node,
else
of_device_make_bus_id(&dev->dev);

/* setup amba-specific device info */
dev->dma_mask = ~0;

/* Allow the HW Peripheral ID to be overridden */
prop = of_get_property(node, "arm,primecell-periphid", NULL);
if (prop)
Expand Down
2 changes: 0 additions & 2 deletions include/linux/amba/bus.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ struct amba_device {
struct device dev;
struct resource res;
struct clk *pclk;
u64 dma_mask;
unsigned int periphid;
unsigned int irq[AMBA_NR_IRQS];
};
Expand Down Expand Up @@ -131,7 +130,6 @@ struct amba_device name##_device = { \
struct amba_device name##_device = { \
.dev = __AMBA_DEV(busid, data, ~0ULL), \
.res = DEFINE_RES_MEM(base, SZ_4K), \
.dma_mask = ~0ULL, \
.irq = irqs, \
.periphid = id, \
}
Expand Down

0 comments on commit 446b2a9

Please sign in to comment.