summaryrefslogtreecommitdiff
path: root/arch/arm/mach-mx1/devices.c
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-06-10 20:02:25 +0400
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-06-24 17:40:45 +0400
commit3e876935b805966f140bdae73f96bc4c3632c947 (patch)
tree54c461e530a3325459dfd32c775a98e1b3eb6ffa /arch/arm/mach-mx1/devices.c
parent8f785e8549fbf73995a7795651709b458300ed01 (diff)
downloadlinux-3e876935b805966f140bdae73f96bc4c3632c947.tar.xz
ARM: imx1: rename imx_uart[12]_device to follow a common naming scheme
Note that these devices are specific for imx1 as only here three irqs are used. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx1/devices.c')
-rw-r--r--arch/arm/mach-mx1/devices.c81
1 files changed, 29 insertions, 52 deletions
diff --git a/arch/arm/mach-mx1/devices.c b/arch/arm/mach-mx1/devices.c
index c770aa0a10de..a79e6132dbe5 100644
--- a/arch/arm/mach-mx1/devices.c
+++ b/arch/arm/mach-mx1/devices.c
@@ -73,59 +73,36 @@ struct platform_device imx_i2c_device0 = {
.num_resources = ARRAY_SIZE(imx_i2c_resources),
};
-static struct resource imx_uart1_resources[] = {
- {
- .start = MX1_UART1_BASE_ADDR,
- .end = MX1_UART1_BASE_ADDR + 0xD0,
- .flags = IORESOURCE_MEM,
- }, {
- .start = MX1_UART1_MINT_RX,
- .end = MX1_UART1_MINT_RX,
- .flags = IORESOURCE_IRQ,
- }, {
- .start = MX1_UART1_MINT_TX,
- .end = MX1_UART1_MINT_TX,
- .flags = IORESOURCE_IRQ,
- }, {
- .start = MX1_UART1_MINT_RTS,
- .end = MX1_UART1_MINT_RTS,
- .flags = IORESOURCE_IRQ,
- },
-};
-
-struct platform_device imx_uart1_device = {
- .name = "imx-uart",
- .id = 0,
- .num_resources = ARRAY_SIZE(imx_uart1_resources),
- .resource = imx_uart1_resources,
-};
-
-static struct resource imx_uart2_resources[] = {
- {
- .start = MX1_UART2_BASE_ADDR,
- .end = MX1_UART2_BASE_ADDR + 0xD0,
- .flags = IORESOURCE_MEM,
- }, {
- .start = MX1_UART2_MINT_RX,
- .end = MX1_UART2_MINT_RX,
- .flags = IORESOURCE_IRQ,
- }, {
- .start = MX1_UART2_MINT_TX,
- .end = MX1_UART2_MINT_TX,
- .flags = IORESOURCE_IRQ,
- }, {
- .start = MX1_UART2_MINT_RTS,
- .end = MX1_UART2_MINT_RTS,
- .flags = IORESOURCE_IRQ,
- },
-};
+#define DEFINE_IMX1_UART_DEVICE(n, baseaddr, irqrx, irqtx, irqrts) \
+ static struct resource imx1_uart_resources ## n[] = { \
+ { \
+ .start = baseaddr, \
+ .end = baseaddr + 0xd0, \
+ .flags = IORESOURCE_MEM, \
+ }, { \
+ .start = irqrx, \
+ .end = irqrx, \
+ .flags = IORESOURCE_IRQ, \
+ }, { \
+ .start = irqtx, \
+ .end = irqtx, \
+ .flags = IORESOURCE_IRQ, \
+ }, { \
+ .start = irqrts, \
+ .end = irqrts, \
+ .flags = IORESOURCE_IRQ, \
+ }, \
+ }; \
+ \
+ struct platform_device imx1_uart_device ## n = { \
+ .name = "imx-uart", \
+ .id = n, \
+ .num_resources = ARRAY_SIZE(imx1_uart_resources ## n), \
+ .resource = imx1_uart_resources ## n, \
+ }
-struct platform_device imx_uart2_device = {
- .name = "imx-uart",
- .id = 1,
- .num_resources = ARRAY_SIZE(imx_uart2_resources),
- .resource = imx_uart2_resources,
-};
+DEFINE_IMX1_UART_DEVICE(0, MX1_UART1_BASE_ADDR, MX1_UART1_MINT_RX, MX1_UART1_MINT_TX, MX1_UART1_MINT_RTS);
+DEFINE_IMX1_UART_DEVICE(1, MX1_UART2_BASE_ADDR, MX1_UART2_MINT_RX, MX1_UART2_MINT_TX, MX1_UART2_MINT_RTS);
static struct resource imx_rtc_resources[] = {
{