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) ...@@ -2405,17 +2405,22 @@ int uart_register_port(struct uart_driver *drv, struct uart_port *port)
goto out; goto out;
} }
state->port->iobase = port->iobase; /*
state->port->membase = port->membase; * If the port is already initialised, don't touch it.
state->port->irq = port->irq; */
state->port->uartclk = port->uartclk; if (state->port->type == PORT_UNKNOWN) {
state->port->fifosize = port->fifosize; state->port->iobase = port->iobase;
state->port->regshift = port->regshift; state->port->membase = port->membase;
state->port->iotype = port->iotype; state->port->irq = port->irq;
state->port->flags = port->flags; state->port->uartclk = port->uartclk;
state->port->line = state - drv->state; state->port->fifosize = port->fifosize;
state->port->regshift = port->regshift;
__uart_register_port(drv, state, state->port); 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; ret = state->port->line;
} else } 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