aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mxs/devices.c
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@freescale.com>2011-01-04 01:20:52 -0500
committerSascha Hauer <s.hauer@pengutronix.de>2011-01-12 08:47:15 -0500
commitdbc4245bb520580fc1b01105727fde7d7cbe452d (patch)
tree993aa43d0831ddb9a981640a9bf48bb92e8e78bf /arch/arm/mach-mxs/devices.c
parent48f76ed1cc034c682666c43815fd0ef27c2a7215 (diff)
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 @@
19#include <linux/kernel.h> 19#include <linux/kernel.h>
20#include <linux/slab.h> 20#include <linux/slab.h>
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/err.h>
23#include <linux/platform_device.h> 22#include <linux/platform_device.h>
24#include <mach/common.h> 23#include <linux/amba/bus.h>
25 24
26struct platform_device *__init mxs_add_platform_device_dmamask( 25struct platform_device *__init mxs_add_platform_device_dmamask(
27 const char *name, int id, 26 const char *name, int id,
@@ -73,3 +72,17 @@ err:
73 72
74 return pdev; 73 return pdev;
75} 74}
75
76int __init mxs_add_amba_device(const struct amba_device *dev)
77{
78 struct amba_device *adev = kmalloc(sizeof(*adev), GFP_KERNEL);
79
80 if (!adev) {
81 pr_err("%s: failed to allocate memory", __func__);
82 return -ENOMEM;
83 }
84
85 *adev = *dev;
86
87 return amba_device_register(adev, &iomem_resource);
88}