aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ux500/devices-common.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2011-12-18 06:16:59 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-01-25 06:02:02 -0500
commit46d4bb9b52829c7d94c528201f27f6288be3f45e (patch)
tree75179c8e6384c599d6d422471d1dc3db32fe44f1 /arch/arm/mach-ux500/devices-common.c
parentc0f72f8a9279f82520fc476c32c09f693661c5f4 (diff)
ARM: amba: ux500: convert to use amba_device_alloc
Convert ux500 to use the new amba_device_alloc APIs. Acked-by: srinidhi kasagar <srinidhi.kasagar@stericsson.com> Acked-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.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/arch/arm/mach-ux500/devices-common.c b/arch/arm/mach-ux500/devices-common.c
index c563e5418d80..e8c34fabc3c7 100644
--- a/arch/arm/mach-ux500/devices-common.c
+++ b/arch/arm/mach-ux500/devices-common.c
@@ -26,16 +26,10 @@ dbx500_add_amba_device(const char *name, resource_size_t base,
26 struct amba_device *dev; 26 struct amba_device *dev;
27 int ret; 27 int ret;
28 28
29 dev = kzalloc(sizeof *dev, GFP_KERNEL); 29 dev = amba_device_alloc(name, base, SZ_4K);
30 if (!dev) 30 if (!dev)
31 return ERR_PTR(-ENOMEM); 31 return ERR_PTR(-ENOMEM);
32 32
33 dev->dev.init_name = name;
34
35 dev->res.start = base;
36 dev->res.end = base + SZ_4K - 1;
37 dev->res.flags = IORESOURCE_MEM;
38
39 dev->dma_mask = DMA_BIT_MASK(32); 33 dev->dma_mask = DMA_BIT_MASK(32);
40 dev->dev.coherent_dma_mask = DMA_BIT_MASK(32); 34 dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
41 35
@@ -46,9 +40,9 @@ dbx500_add_amba_device(const char *name, resource_size_t base,
46 40
47 dev->dev.platform_data = pdata; 41 dev->dev.platform_data = pdata;
48 42
49 ret = amba_device_register(dev, &iomem_resource); 43 ret = amba_device_add(dev, &iomem_resource);
50 if (ret) { 44 if (ret) {
51 kfree(dev); 45 amba_device_put(dev);
52 return ERR_PTR(ret); 46 return ERR_PTR(ret);
53 } 47 }
54 48