Skip to content

Commit

Permalink
ARM: OMAP2+: UART: remove temporary variable used to count uart instance
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Govindraj.R authored and Kevin Hilman committed Dec 15, 2011
1 parent a9e210e commit 969996a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions arch/arm/mach-omap2/serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
Expand Down

0 comments on commit 969996a

Please sign in to comment.