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>
This commit is contained in:
committed by
Kevin Hilman
parent
a9e210e0b7
commit
969996a57f
@@ -266,15 +266,13 @@ static void omap_serial_fill_default_pads(struct omap_board_data *bdata) {}
|
|||||||
|
|
||||||
static int __init omap_serial_early_init(void)
|
static int __init omap_serial_early_init(void)
|
||||||
{
|
{
|
||||||
int i = 0;
|
|
||||||
|
|
||||||
do {
|
do {
|
||||||
char oh_name[MAX_UART_HWMOD_NAME_LEN];
|
char oh_name[MAX_UART_HWMOD_NAME_LEN];
|
||||||
struct omap_hwmod *oh;
|
struct omap_hwmod *oh;
|
||||||
struct omap_uart_state *uart;
|
struct omap_uart_state *uart;
|
||||||
|
|
||||||
snprintf(oh_name, MAX_UART_HWMOD_NAME_LEN,
|
snprintf(oh_name, MAX_UART_HWMOD_NAME_LEN,
|
||||||
"uart%d", i + 1);
|
"uart%d", num_uarts + 1);
|
||||||
oh = omap_hwmod_lookup(oh_name);
|
oh = omap_hwmod_lookup(oh_name);
|
||||||
if (!oh)
|
if (!oh)
|
||||||
break;
|
break;
|
||||||
@@ -284,9 +282,8 @@ static int __init omap_serial_early_init(void)
|
|||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
uart->oh = oh;
|
uart->oh = oh;
|
||||||
uart->num = i++;
|
uart->num = num_uarts++;
|
||||||
list_add_tail(&uart->node, &uart_list);
|
list_add_tail(&uart->node, &uart_list);
|
||||||
num_uarts++;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NOTE: omap_hwmod_setup*() has not yet been called,
|
* NOTE: omap_hwmod_setup*() has not yet been called,
|
||||||
|
Reference in New Issue
Block a user