diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2012-04-03 07:00:18 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-04-19 14:31:34 -0400 |
commit | 08956a0e8a697edb566766536b2fbbb168ac6ecc (patch) | |
tree | bbde880150dc9cbb774003f2255ce5706067adfe /arch/arm/mach-ux500/devices-common.c | |
parent | 4ff35d863ea2cbce2dc6c708b80be12e5b74226b (diff) |
ARM: 7372/1: ux500: factor out dynamic amba device allocator
This replaces the dynamic device allocator in the ux500 machine
with the common device allocator in the bus code.
Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
Cc: Rabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-ux500/devices-common.c')
-rw-r--r-- | arch/arm/mach-ux500/devices-common.c | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/arch/arm/mach-ux500/devices-common.c b/arch/arm/mach-ux500/devices-common.c index c5312a4b49f5..dfdd4a54668d 100644 --- a/arch/arm/mach-ux500/devices-common.c +++ b/arch/arm/mach-ux500/devices-common.c | |||
@@ -11,7 +11,6 @@ | |||
11 | #include <linux/irq.h> | 11 | #include <linux/irq.h> |
12 | #include <linux/slab.h> | 12 | #include <linux/slab.h> |
13 | #include <linux/platform_device.h> | 13 | #include <linux/platform_device.h> |
14 | #include <linux/amba/bus.h> | ||
15 | 14 | ||
16 | #include <plat/gpio-nomadik.h> | 15 | #include <plat/gpio-nomadik.h> |
17 | 16 | ||
@@ -19,38 +18,6 @@ | |||
19 | 18 | ||
20 | #include "devices-common.h" | 19 | #include "devices-common.h" |
21 | 20 | ||
22 | struct amba_device * | ||
23 | dbx500_add_amba_device(struct device *parent, const char *name, | ||
24 | resource_size_t base, int irq, void *pdata, | ||
25 | unsigned int periphid) | ||
26 | { | ||
27 | struct amba_device *dev; | ||
28 | int ret; | ||
29 | |||
30 | dev = amba_device_alloc(name, base, SZ_4K); | ||
31 | if (!dev) | ||
32 | return ERR_PTR(-ENOMEM); | ||
33 | |||
34 | dev->dma_mask = DMA_BIT_MASK(32); | ||
35 | dev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | ||
36 | |||
37 | dev->irq[0] = irq; | ||
38 | |||
39 | dev->periphid = periphid; | ||
40 | |||
41 | dev->dev.platform_data = pdata; | ||
42 | |||
43 | dev->dev.parent = parent; | ||
44 | |||
45 | ret = amba_device_add(dev, &iomem_resource); | ||
46 | if (ret) { | ||
47 | amba_device_put(dev); | ||
48 | return ERR_PTR(ret); | ||
49 | } | ||
50 | |||
51 | return dev; | ||
52 | } | ||
53 | |||
54 | static struct platform_device * | 21 | static struct platform_device * |
55 | dbx500_add_gpio(struct device *parent, int id, resource_size_t addr, int irq, | 22 | dbx500_add_gpio(struct device *parent, int id, resource_size_t addr, int irq, |
56 | struct nmk_gpio_platform_data *pdata) | 23 | struct nmk_gpio_platform_data *pdata) |