- serio_interrupt(&up->serio, ch, 0, regs);
+ serio_interrupt(up->serio, ch, 0, regs);
#endif
} else if (up->su_type == SU_PORT_MS) {
int ret = suncore_mouse_baud_detection(ch, is_break);
#endif
} else if (up->su_type == SU_PORT_MS) {
int ret = suncore_mouse_baud_detection(ch, is_break);
- serio_interrupt(&up->serio, ch, 0, regs);
+ serio_interrupt(up->serio, ch, 0, regs);
- for (i = 0, up = sunsu_ports; i < 2; i++, up++) {
- up->port.line = i;
- up->port.type = PORT_UNKNOWN;
- up->port.uartclk = (SU_BASE_BAUD * 16);
+ up->port.line = channel;
+ up->port.type = PORT_UNKNOWN;
+ up->port.uartclk = (SU_BASE_BAUD * 16);
- if (up->su_type == SU_PORT_KBD)
- up->cflag = B1200 | CS8 | CLOCAL | CREAD;
- else
- up->cflag = B4800 | CS8 | CLOCAL | CREAD;
+ if (up->su_type == SU_PORT_KBD)
+ up->cflag = B1200 | CS8 | CLOCAL | CREAD;
+ else
+ up->cflag = B4800 | CS8 | CLOCAL | CREAD;
- printk(KERN_INFO "su%d at 0x%p (irq = %s) is a %s\n",
- i,
- up->port.membase, __irq_itoa(up->irq),
- sunsu_type(&up->port));
+ printk(KERN_INFO "su%d at 0x%p (irq = %s) is a %s\n",
+ channel,
+ up->port.membase, __irq_itoa(up->irq),
+ sunsu_type(&up->port));
- memset(&up->serio, 0, sizeof(up->serio));
+ up->serio = serio = kmalloc(sizeof(struct serio), GFP_KERNEL);
+ if (serio) {
+ memset(serio, 0, sizeof(*serio));
- up->serio.type |= SERIO_SUNKBD;
- up->serio.name = "sukbd";
+ serio->type |= SERIO_SUNKBD;
+ strlcpy(serio->name, "sukbd", sizeof(serio->name));
- up->serio.type |= (SERIO_SUN | (1 << 16));
- up->serio.name = "sums";
+ serio->type |= (SERIO_SUN | (1 << 16));
+ strlcpy(serio->name, "sums", sizeof(serio->name));
- up->serio.write = sunsu_serio_write;
- up->serio.open = sunsu_serio_open;
- up->serio.close = sunsu_serio_close;
+ serio->write = sunsu_serio_write;
+ serio->open = sunsu_serio_open;
+ serio->close = sunsu_serio_close;
if (scan.msx != -1 && scan.kbx != -1) {
sunsu_ports[0].su_type = SU_PORT_MS;
sunsu_ports[0].port_node = scan.msnode;
if (scan.msx != -1 && scan.kbx != -1) {
sunsu_ports[0].su_type = SU_PORT_MS;
sunsu_ports[0].port_node = scan.msnode;
#endif
} else if (up->port.type != PORT_UNKNOWN) {
uart_remove_one_port(&sunsu_reg, &up->port);
#endif
} else if (up->port.type != PORT_UNKNOWN) {
uart_remove_one_port(&sunsu_reg, &up->port);