diff options
Diffstat (limited to 'arch/arm/mach-ux500/devices-common.c')
-rw-r--r-- | arch/arm/mach-ux500/devices-common.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/arch/arm/mach-ux500/devices-common.c b/arch/arm/mach-ux500/devices-common.c index c563e5418d80..898a64517b09 100644 --- a/arch/arm/mach-ux500/devices-common.c +++ b/arch/arm/mach-ux500/devices-common.c | |||
@@ -26,29 +26,22 @@ 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 | ||
42 | dev->irq[0] = irq; | 36 | dev->irq[0] = irq; |
43 | dev->irq[1] = NO_IRQ; | ||
44 | 37 | ||
45 | dev->periphid = periphid; | 38 | dev->periphid = periphid; |
46 | 39 | ||
47 | dev->dev.platform_data = pdata; | 40 | dev->dev.platform_data = pdata; |
48 | 41 | ||
49 | ret = amba_device_register(dev, &iomem_resource); | 42 | ret = amba_device_add(dev, &iomem_resource); |
50 | if (ret) { | 43 | if (ret) { |
51 | kfree(dev); | 44 | amba_device_put(dev); |
52 | return ERR_PTR(ret); | 45 | return ERR_PTR(ret); |
53 | } | 46 | } |
54 | 47 | ||