aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/serial.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/serial.c')
-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 5dd928945033..8e0d0062cb15 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) {}
266 266
267static int __init omap_serial_early_init(void) 267static int __init omap_serial_early_init(void)
268{ 268{
269 int i = 0;
270
271 do { 269 do {
272 char oh_name[MAX_UART_HWMOD_NAME_LEN]; 270 char oh_name[MAX_UART_HWMOD_NAME_LEN];
273 struct omap_hwmod *oh; 271 struct omap_hwmod *oh;
274 struct omap_uart_state *uart; 272 struct omap_uart_state *uart;
275 273
276 snprintf(oh_name, MAX_UART_HWMOD_NAME_LEN, 274 snprintf(oh_name, MAX_UART_HWMOD_NAME_LEN,
277 "uart%d", i + 1); 275 "uart%d", num_uarts + 1);
278 oh = omap_hwmod_lookup(oh_name); 276 oh = omap_hwmod_lookup(oh_name);
279 if (!oh) 277 if (!oh)
280 break; 278 break;
@@ -284,9 +282,8 @@ static int __init omap_serial_early_init(void)
284 return -ENODEV; 282 return -ENODEV;
285 283
286 uart->oh = oh; 284 uart->oh = oh;
287 uart->num = i++; 285 uart->num = num_uarts++;
288 list_add_tail(&uart->node, &uart_list); 286 list_add_tail(&uart->node, &uart_list);
289 num_uarts++;
290 287
291 /* 288 /*
292 * NOTE: omap_hwmod_setup*() has not yet been called, 289 * NOTE: omap_hwmod_setup*() has not yet been called,