summaryrefslogtreecommitdiff
path: root/arch/arm/mach-ux500/devices-common.c
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2012-03-04 11:16:38 -0800
committerOlof Johansson <olof@lixom.net>2012-03-04 11:16:38 -0800
commit0e86ca498511d1ff1224a5be7224c83cfcf000e3 (patch)
tree47d9f2d94862f7b7c0bc952af41631dfaa220ead /arch/arm/mach-ux500/devices-common.c
parentf35b431dde39fb40944d1024f08d88fbf04a3193 (diff)
parenta5f17d1f4c2831b9b9bf8b1a537cdbac995d6e13 (diff)
Merge branch 'depends/rmk/for-armsoc' into for-3.4/cleanup-and-fixes
Diffstat (limited to 'arch/arm/mach-ux500/devices-common.c')
-rw-r--r--arch/arm/mach-ux500/devices-common.c13
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,
struct amba_device *dev;
int ret;
- dev = kzalloc(sizeof *dev, GFP_KERNEL);
+ dev = amba_device_alloc(name, base, SZ_4K);
if (!dev)
return ERR_PTR(-ENOMEM);
- dev->dev.init_name = name;
-
- dev->res.start = base;
- dev->res.end = base + SZ_4K - 1;
- dev->res.flags = IORESOURCE_MEM;
-
dev->dma_mask = DMA_BIT_MASK(32);
dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
dev->irq[0] = irq;
- dev->irq[1] = NO_IRQ;
dev->periphid = periphid;
dev->dev.platform_data = pdata;
- ret = amba_device_register(dev, &iomem_resource);
+ ret = amba_device_add(dev, &iomem_resource);
if (ret) {
- kfree(dev);
+ amba_device_put(dev);
return ERR_PTR(ret);
}