summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2011-12-18 12:23:25 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-01-25 12:02:02 +0100
commit039e7ad89211a63d98341e4add4fc6720f383c2a (patch)
treee7832e9d5d517e73ee60847d15298894806888fb
parentARM: amba: integrator: convert to use amba_device_alloc (diff)
downloadlinux-039e7ad89211a63d98341e4add4fc6720f383c2a.tar.xz
linux-039e7ad89211a63d98341e4add4fc6720f383c2a.zip
ARM: amba: mxs: convert to use amba_device_alloc
Convert MXS to use the new amba_device_alloc APIs. Acked-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--arch/arm/mach-mxs/devices.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/arm/mach-mxs/devices.c b/arch/arm/mach-mxs/devices.c
index fe3e847930c9..01faffec3064 100644
--- a/arch/arm/mach-mxs/devices.c
+++ b/arch/arm/mach-mxs/devices.c
@@ -77,16 +77,18 @@ err:
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) {
pr_err("%s: failed to allocate memory", __func__);
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 = {