Commit 1d680b7a authored by Russell King's avatar Russell King

[SERIAL] Prevent PNPBIOS re-registering already detected ports

During initialisation of 8250 serial, we scan a list of ISA ports and
register any ports.  We then perform PNPBIOS scanning, which re-registers
ttyS0.  Unfortunately, if devfs is enabled, devfs reports an error because
we try to create two tts/0 entries.

Therefore, when adding a new port we check that it has not been detected
before attempting to probe the port and register it with devfs (via the
tty layer.)
parent 96aae88a
......@@ -2405,17 +2405,22 @@ int uart_register_port(struct uart_driver *drv, struct uart_port *port)
goto out;
}
state->port->iobase = port->iobase;
state->port->membase = port->membase;
state->port->irq = port->irq;
state->port->uartclk = port->uartclk;
state->port->fifosize = port->fifosize;
state->port->regshift = port->regshift;
state->port->iotype = port->iotype;
state->port->flags = port->flags;
state->port->line = state - drv->state;
__uart_register_port(drv, state, state->port);
/*
* If the port is already initialised, don't touch it.
*/
if (state->port->type == PORT_UNKNOWN) {
state->port->iobase = port->iobase;
state->port->membase = port->membase;
state->port->irq = port->irq;
state->port->uartclk = port->uartclk;
state->port->fifosize = port->fifosize;
state->port->regshift = port->regshift;
state->port->iotype = port->iotype;
state->port->flags = port->flags;
state->port->line = state - drv->state;
__uart_register_port(drv, state, state->port);
}
ret = state->port->line;
} else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment