From 5002484b8ac93e8d32ca75e8a7504dbb9f7926fe Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Tue, 3 Apr 2012 12:11:50 +0100 Subject: ARM: 7370/2: mxs: factor out dynamic amba device allocator Replace the local amba device allocator with the core code from the bus driver. Acked-by: Shawn Guo Signed-off-by: Linus Walleij Signed-off-by: Russell King --- arch/arm/mach-mxs/devices-mx23.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'arch/arm/mach-mxs/devices-mx23.h') diff --git a/arch/arm/mach-mxs/devices-mx23.h b/arch/arm/mach-mxs/devices-mx23.h index 4d1329d59287..9acdd6387047 100644 --- a/arch/arm/mach-mxs/devices-mx23.h +++ b/arch/arm/mach-mxs/devices-mx23.h @@ -11,10 +11,16 @@ #include #include #include +#include -extern const struct amba_device mx23_duart_device __initconst; -#define mx23_add_duart() \ - mxs_add_duart(&mx23_duart_device) +static inline int mx23_add_duart(void) +{ + struct amba_device *d; + + d = amba_ahb_device_add(NULL, "duart", MX23_DUART_BASE_ADDR, SZ_8K, + MX23_INT_DUART, 0, 0, 0); + return IS_ERR(d) ? PTR_ERR(d) : 0; +} extern const struct mxs_auart_data mx23_auart_data[] __initconst; #define mx23_add_auart(id) mxs_add_auart(&mx23_auart_data[id]) -- cgit v1.2.3-59-g8ed1b