Commit 039e7ad8 authored by Russell King's avatar Russell King

ARM: amba: mxs: convert to use amba_device_alloc

Convert MXS to use the new amba_device_alloc APIs.
Acked-by: default avatarShawn Guo <shawn.guo@linaro.org>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 9a25706b
...@@ -77,16 +77,18 @@ struct platform_device *__init mxs_add_platform_device_dmamask( ...@@ -77,16 +77,18 @@ struct platform_device *__init mxs_add_platform_device_dmamask(
int __init mxs_add_amba_device(const struct amba_device *dev) int __init mxs_add_amba_device(const struct amba_device *dev)
{ {
struct amba_device *adev = kmalloc(sizeof(*adev), GFP_KERNEL); struct amba_device *adev = amba_device_alloc(dev->dev.init_name,
dev->res.start, resource_size(&dev->res));
if (!adev) { if (!adev) {
pr_err("%s: failed to allocate memory", __func__); pr_err("%s: failed to allocate memory", __func__);
return -ENOMEM; return -ENOMEM;
} }
*adev = *dev; adev->irq[0] = dev->irq[0];
adev->irq[1] = dev->irq[1];
return amba_device_register(adev, &iomem_resource); return amba_device_add(adev, &iomem_resource);
} }
struct device mxs_apbh_bus = { struct device mxs_apbh_bus = {
......
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