diff options
author | Govindraj.R <govindraj.raja@ti.com> | 2011-10-18 07:02:14 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@ti.com> | 2011-12-14 19:05:25 -0500 |
commit | 969996a57fd2345a1141280dddcf9e10fa5f6690 (patch) | |
tree | 90ed7a70a052b4104c9811fc4d192f878cf2908d /arch/arm/mach-omap2/serial.c | |
parent | a9e210e0b7a344c0e44aa6bf6888176bbc635c42 (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/serial.c')
-rw-r--r-- | arch/arm/mach-omap2/serial.c | 7 |
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 | ||
267 | static int __init omap_serial_early_init(void) | 267 | static 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, |