aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorGovindraj.R <govindraj.raja@ti.com>2011-10-18 16:32:14 +0530
committerKevin Hilman <khilman@ti.com>2011-12-14 16:05:25 -0800
commit969996a57fd2345a1141280dddcf9e10fa5f6690 (patch)
tree90ed7a70a052b4104c9811fc4d192f878cf2908d /arch/arm/mach-omap2
parenta9e210e0b7a344c0e44aa6bf6888176bbc635c42 (diff)
ARM: OMAP2+: UART: remove temporary variable used to count uart instance
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>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/serial.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 5dd92894503..8e0d0062cb1 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -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,