ARM: imx1: rename imx_uart[12]_device to follow a common naming scheme
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thu, 10 Jun 2010 16:02:25 +0000 (18:02 +0200)
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thu, 24 Jun 2010 13:40:45 +0000 (15:40 +0200)
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>
arch/arm/mach-mx1/devices.c
arch/arm/mach-mx1/devices.h
arch/arm/mach-mx1/mach-mx1ads.c
arch/arm/mach-mx1/mach-scb9328.c

index c770aa0a10de200cea9a4e04976c7390e30bcb57..a79e6132dbe506819c6ad697c36c276dbac31186 100644 (file)
@@ -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[] = {
        {
index 851d6dfccf2e6ff99842304c0a00859cc41b2dab..13325166f63927254620be2737b808a20ebde0a6 100644 (file)
@@ -1,7 +1,7 @@
 extern struct platform_device imx1_camera_device;
 extern struct platform_device imx_i2c_device0;
-extern struct platform_device imx_uart1_device;
-extern struct platform_device imx_uart2_device;
+extern struct platform_device imx1_uart_device0;
+extern struct platform_device imx1_uart_device1;
 extern struct platform_device imx_rtc_device;
 extern struct platform_device imx_wdt_device;
 extern struct platform_device imx_usb_device;
index 16adc61947060f5ba1913b109e251c5ab49f02cd..5d7c85f8aaf563a98cfd42574ff5a2a95e0f3af1 100644 (file)
@@ -121,8 +121,8 @@ static void __init mx1ads_init(void)
                ARRAY_SIZE(mx1ads_pins), "mx1ads");
 
        /* UART */
-       mxc_register_device(&imx_uart1_device, &uart_pdata[0]);
-       mxc_register_device(&imx_uart2_device, &uart_pdata[1]);
+       mxc_register_device(&imx1_uart_device0, &uart_pdata[0]);
+       mxc_register_device(&imx1_uart_device1, &uart_pdata[1]);
 
        /* Physmap flash */
        mxc_register_device(&flash_device, &mx1ads_flash_data);
index ed2ff162c380c47186a8b6b10ee00ea0611f312b..482b24df46247d33e03e0dcb2a02297588cbada0 100644 (file)
@@ -130,7 +130,7 @@ static struct platform_device *devices[] __initdata = {
  */
 static void __init scb9328_init(void)
 {
-       mxc_register_device(&imx_uart1_device, &uart_pdata);
+       mxc_register_device(&imx1_uart_device0, &uart_pdata);
 
        printk(KERN_INFO"Scb9328: Adding devices\n");
        platform_add_devices(devices, ARRAY_SIZE(devices));