summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Dillow <dave@thedillows.org>2004-01-04 19:23:47 -0800
committerDavid Dillow <dave@thedillows.org>2004-01-04 19:23:47 -0800
commit5d65805989856b0f3ddd4e512e0dad1cfa0a330d (patch)
tree62f11c0ed6ac17a5b7cb853d8fbc4f72c62e43c8
parent233c458eccc2d0eb42c55e17fa624ff35cdff6ad (diff)
[SUNZILOG]: Register the correct number of ports, ignore keyb/mouse lines.
-rw-r--r--drivers/serial/sunzilog.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c
index ee859f9d3040..1f343cc2b952 100644
--- a/drivers/serial/sunzilog.c
+++ b/drivers/serial/sunzilog.c
@@ -1631,6 +1631,8 @@ static int __init sunzilog_ports_init(void)
{
struct zs_probe_scan scan;
int ret;
+ int uart_count;
+ int i;
printk(KERN_DEBUG "SunZilog: %d chips.\n", NUM_SUNZILOG);
@@ -1650,18 +1652,27 @@ static int __init sunzilog_ports_init(void)
sunzilog_init_hw();
/* We can only init this once we have probed the Zilogs
- * in the system.
+ * in the system. Do not count channels assigned to keyboards
+ * or mice when we are deciding how many ports to register.
*/
- sunzilog_reg.nr = NUM_CHANNELS;
+ uart_count = 0;
+ for (i = 0; i < NUM_CHANNELS; i++) {
+ struct uart_sunzilog_port *up = &sunzilog_port_table[i];
+
+ if (ZS_IS_KEYB(up) || ZS_IS_MOUSE(up))
+ continue;
+
+ uart_count++;
+ }
+
+ sunzilog_reg.nr = uart_count;
sunzilog_reg.cons = SUNZILOG_CONSOLE;
sunzilog_reg.minor = sunserial_current_minor;
- sunserial_current_minor += NUM_CHANNELS;
+ sunserial_current_minor += uart_count;
ret = uart_register_driver(&sunzilog_reg);
if (ret == 0) {
- int i;
-
for (i = 0; i < NUM_CHANNELS; i++) {
struct uart_sunzilog_port *up = &sunzilog_port_table[i];