Commit 33b42bcb authored by Russell King's avatar Russell King

[SERIAL] 8250: Warn when ports with zero base_baud are registered.

parent 383d6a28
...@@ -2508,11 +2508,26 @@ int register_serial(struct serial_struct *req) ...@@ -2508,11 +2508,26 @@ int register_serial(struct serial_struct *req)
port.iobase |= (long) req->port_high << HIGH_BITS_OFFSET; port.iobase |= (long) req->port_high << HIGH_BITS_OFFSET;
/* /*
* If a clock rate wasn't specified by the low level * If a clock rate wasn't specified by the low level driver, then
* driver, then default to the standard clock rate. * default to the standard clock rate. This should be 115200 (*16)
* and should not depend on the architecture's BASE_BAUD definition.
* However, since this API will be deprecated, it's probably a
* better idea to convert the drivers to use the new API
* (serial8250_register_port and serial8250_unregister_port).
*/
if (port.uartclk == 0) {
printk(KERN_WARNING
"Serial: registering port at [%08lx,%08lx,%p] irq %d with zero baud_base\n",
port.iobase, port.mapbase, port.membase, port.irq);
printk(KERN_WARNING "Serial: see %s:%d for more information\n",
__FILE__, __LINE__);
dump_stack();
/*
* Fix it up for now, but this is only a temporary measure.
*/ */
if (port.uartclk == 0)
port.uartclk = BASE_BAUD * 16; port.uartclk = BASE_BAUD * 16;
}
return serial8250_register_port(&port); return serial8250_register_port(&port);
} }
......
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