]> Pileus Git - ~andy/linux/commitdiff
ARM: OMAP2+: UART: remove temporary variable used to count uart instance
authorGovindraj.R <govindraj.raja@ti.com>
Tue, 18 Oct 2011 11:02:14 +0000 (16:32 +0530)
committerKevin Hilman <khilman@ti.com>
Thu, 15 Dec 2011 00:05:25 +0000 (16:05 -0800)
Reuse the num_uarts variable itself to count number of uarts.

Signed-off-by: Govindraj.R <govindraj.raja@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
arch/arm/mach-omap2/serial.c

index 5dd9289450333a32b0091dbe5d58ecde835fd985..8e0d0062cb15aeb455f063d0d028d5fd1469ed95 100644 (file)
@@ -266,15 +266,13 @@ static void omap_serial_fill_default_pads(struct omap_board_data *bdata) {}
 
 static int __init omap_serial_early_init(void)
 {
-       int i = 0;
-
        do {
                char oh_name[MAX_UART_HWMOD_NAME_LEN];
                struct omap_hwmod *oh;
                struct omap_uart_state *uart;
 
                snprintf(oh_name, MAX_UART_HWMOD_NAME_LEN,
-                        "uart%d", i + 1);
+                        "uart%d", num_uarts + 1);
                oh = omap_hwmod_lookup(oh_name);
                if (!oh)
                        break;
@@ -284,9 +282,8 @@ static int __init omap_serial_early_init(void)
                        return -ENODEV;
 
                uart->oh = oh;
-               uart->num = i++;
+               uart->num = num_uarts++;
                list_add_tail(&uart->node, &uart_list);
-               num_uarts++;
 
                /*
                 * NOTE: omap_hwmod_setup*() has not yet been called,