if (nr_uarts > UART_NR)
nr_uarts = UART_NR;
- for (i = 0; i < nr_uarts; i++) {
+ for (i = 0; i < UART_NR; i++) {
struct uart_8250_port *up = &serial8250_ports[i];
struct uart_port *port = &up->port;
* if so, search for the first available port that does have
* console support.
*/
- if (co->index >= nr_uarts)
+ if (co->index >= UART_NR)
co->index = 0;
port = &serial8250_ports[co->index].port;
if (!port->iobase && !port->membase)
int line;
struct uart_port *port;
- for (line = 0; line < nr_uarts; line++) {
+ for (line = 0; line < UART_NR; line++) {
port = &serial8250_ports[line].port;
if (uart_match_port(p, port))
return line;
{
int i;
- for (i = 0; i < nr_uarts; i++) {
+ for (i = 0; i < UART_NR; i++) {
struct uart_8250_port *up = &serial8250_ports[i];
if (up->port.dev == &dev->dev)
/*
* First, find a port entry which matches.
*/
- for (i = 0; i < nr_uarts; i++)
+ for (i = 0; i < UART_NR; i++)
if (uart_match_port(&serial8250_ports[i].port, port))
return &serial8250_ports[i];
* free entry. We look for one which hasn't been previously
* used (indicated by zero iobase).
*/
- for (i = 0; i < nr_uarts; i++)
+ for (i = 0; i < UART_NR; i++)
if (serial8250_ports[i].port.type == PORT_UNKNOWN &&
serial8250_ports[i].port.iobase == 0)
return &serial8250_ports[i];
* That also failed. Last resort is to find any entry which
* doesn't have a real port associated with it.
*/
- for (i = 0; i < nr_uarts; i++)
+ for (i = 0; i < UART_NR; i++)
if (serial8250_ports[i].port.type == PORT_UNKNOWN)
return &serial8250_ports[i];