Commit 46d4bb9b authored by Russell King's avatar Russell King

ARM: amba: ux500: convert to use amba_device_alloc

Convert ux500 to use the new amba_device_alloc APIs.
Acked-by: default avatarsrinidhi kasagar <srinidhi.kasagar@stericsson.com>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent c0f72f8a
...@@ -26,16 +26,10 @@ dbx500_add_amba_device(const char *name, resource_size_t base, ...@@ -26,16 +26,10 @@ dbx500_add_amba_device(const char *name, resource_size_t base,
struct amba_device *dev; struct amba_device *dev;
int ret; int ret;
dev = kzalloc(sizeof *dev, GFP_KERNEL); dev = amba_device_alloc(name, base, SZ_4K);
if (!dev) if (!dev)
return ERR_PTR(-ENOMEM); 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->dma_mask = DMA_BIT_MASK(32);
dev->dev.coherent_dma_mask = DMA_BIT_MASK(32); dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
...@@ -46,9 +40,9 @@ dbx500_add_amba_device(const char *name, resource_size_t base, ...@@ -46,9 +40,9 @@ dbx500_add_amba_device(const char *name, resource_size_t base,
dev->dev.platform_data = pdata; dev->dev.platform_data = pdata;
ret = amba_device_register(dev, &iomem_resource); ret = amba_device_add(dev, &iomem_resource);
if (ret) { if (ret) {
kfree(dev); amba_device_put(dev);
return ERR_PTR(ret); return ERR_PTR(ret);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment