summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mxs/devices.c
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@freescale.com>2011-01-04 07:20:52 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2011-01-12 14:47:15 +0100
commitdbc4245bb520580fc1b01105727fde7d7cbe452d (patch)
tree993aa43d0831ddb9a981640a9bf48bb92e8e78bf /arch/arm/mach-mxs/devices.c
parentARM: mx28: add the second fec device registration (diff)
downloadlinux-dbc4245bb520580fc1b01105727fde7d7cbe452d.tar.xz
linux-dbc4245bb520580fc1b01105727fde7d7cbe452d.zip
ARM: mxs: Change duart device to use amba-pl011
The mxs duart is actually an amba-pl011 device. This commit changes the duart device code to dynamically allocate amba-pl011 device, so that drivers/serial/amba-pl011.c can be used on mxs. Signed-off-by: Shawn Guo <shawn.guo@freescale.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mxs/devices.c')
-rw-r--r--arch/arm/mach-mxs/devices.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/arch/arm/mach-mxs/devices.c b/arch/arm/mach-mxs/devices.c
index 6b60f02ca2e3..c20d54740b0b 100644
--- a/arch/arm/mach-mxs/devices.c
+++ b/arch/arm/mach-mxs/devices.c
@@ -19,9 +19,8 @@
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/init.h>
-#include <linux/err.h>
#include <linux/platform_device.h>
-#include <mach/common.h>
+#include <linux/amba/bus.h>
struct platform_device *__init mxs_add_platform_device_dmamask(
const char *name, int id,
@@ -73,3 +72,17 @@ err:
return pdev;
}
+
+int __init mxs_add_amba_device(const struct amba_device *dev)
+{
+ struct amba_device *adev = kmalloc(sizeof(*adev), GFP_KERNEL);
+
+ if (!adev) {
+ pr_err("%s: failed to allocate memory", __func__);
+ return -ENOMEM;
+ }
+
+ *adev = *dev;
+
+ return amba_device_register(adev, &iomem_resource);
+}