From: Stephen Rothwell This patch starts cleaing up (and paring down) the virtual console driver. It does: - viocons is NOT a serial driver - remove unneeded empty methods - change the console name --- 25-akpm/drivers/char/viocons.c | 89 +---------------------------------------- 1 files changed, 3 insertions(+), 86 deletions(-) diff -puN drivers/char/viocons.c~ppc64-iseries-cleanups drivers/char/viocons.c --- 25/drivers/char/viocons.c~ppc64-iseries-cleanups 2004-03-23 02:05:25.500226872 -0800 +++ 25-akpm/drivers/char/viocons.c 2004-03-23 02:05:25.503226416 -0800 @@ -57,7 +57,6 @@ #define VIOTTY_MAGIC (0x0DCB) #define VTTY_PORTS 10 -#define VIOTTY_SERIAL_START 65 #define VIOCONS_KERN_WARN KERN_WARNING "viocons: " #define VIOCONS_KERN_INFO KERN_INFO "viocons: " @@ -141,7 +140,6 @@ static struct port_info { static void initDataEvent(struct viocharlpevent *viochar, HvLpIndex lp); static struct tty_driver *viotty_driver; -static struct tty_driver *viottyS_driver; void hvlog(char *fmt, ...) { @@ -658,14 +656,14 @@ static struct tty_driver *viocons_device * console device I/O methods */ static struct console viocons_early = { - .name = "ttyS", + .name = "viocons", .write = viocons_write_early, .flags = CON_PRINTBUFFER, .index = -1, }; static struct console viocons = { - .name = "ttyS", + .name = "viocons", .write = viocons_write, .device = viocons_device, .flags = CON_PRINTBUFFER, @@ -683,9 +681,6 @@ static int viotty_open(struct tty_struct port = tty->index; - if (port >= VIOTTY_SERIAL_START) - port -= VIOTTY_SERIAL_START; - if ((port < 0) || (port >= VTTY_PORTS)) return -ENODEV; @@ -823,13 +818,6 @@ static void viotty_put_char(struct tty_s } /* - * TTY flush_chars method - */ -static void viotty_flush_chars(struct tty_struct *tty) -{ -} - -/* * TTY write_room method */ static int viotty_write_room(struct tty_struct *tty) @@ -867,17 +855,13 @@ static int viotty_write_room(struct tty_ } /* - * TTY chars_in_buffer_room method + * TTY chars_in_buffer method */ static int viotty_chars_in_buffer(struct tty_struct *tty) { return 0; } -static void viotty_flush_buffer(struct tty_struct *tty) -{ -} - static int viotty_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg) { @@ -897,43 +881,6 @@ static int viotty_ioctl(struct tty_struc return n_tty_ioctl(tty, file, cmd, arg); } -static void viotty_throttle(struct tty_struct *tty) -{ -} - -static void viotty_unthrottle(struct tty_struct *tty) -{ -} - -static void viotty_set_termios(struct tty_struct *tty, - struct termios *old_termios) -{ -} - -static void viotty_stop(struct tty_struct *tty) -{ -} - -static void viotty_start(struct tty_struct *tty) -{ -} - -static void viotty_hangup(struct tty_struct *tty) -{ -} - -static void viotty_break(struct tty_struct *tty, int break_state) -{ -} - -static void viotty_send_xchar(struct tty_struct *tty, char ch) -{ -} - -static void viotty_wait_until_sent(struct tty_struct *tty, int timeout) -{ -} - /* * Handle an open charLpEvent. Could be either interrupt or ack */ @@ -1277,20 +1224,9 @@ static struct tty_operations serial_ops .close = viotty_close, .write = viotty_write, .put_char = viotty_put_char, - .flush_chars = viotty_flush_chars, .write_room = viotty_write_room, .chars_in_buffer = viotty_chars_in_buffer, - .flush_buffer = viotty_flush_buffer, .ioctl = viotty_ioctl, - .throttle = viotty_throttle, - .unthrottle = viotty_unthrottle, - .set_termios = viotty_set_termios, - .stop = viotty_stop, - .start = viotty_start, - .hangup = viotty_hangup, - .break_ctl = viotty_break, - .send_xchar = viotty_send_xchar, - .wait_until_sent = viotty_wait_until_sent, }; static int __init viocons_init2(void) @@ -1368,31 +1304,12 @@ static int __init viocons_init2(void) viotty_driver->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_RESET_TERMIOS; tty_set_operations(viotty_driver, &serial_ops); - viottyS_driver = alloc_tty_driver(VTTY_PORTS); - viottyS_driver->owner = THIS_MODULE; - viottyS_driver->driver_name = "vioconsole"; - viottyS_driver->devfs_name = "tts/"; - viottyS_driver->name = "ttyS"; - viottyS_driver->major = TTY_MAJOR; - viottyS_driver->minor_start = VIOTTY_SERIAL_START; - viottyS_driver->type = TTY_DRIVER_TYPE_SERIAL; - viottyS_driver->subtype = 1; - viottyS_driver->init_termios = tty_std_termios; - viottyS_driver->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_RESET_TERMIOS; - tty_set_operations(viottyS_driver, &serial_ops); - if (tty_register_driver(viotty_driver)) { printk(VIOCONS_KERN_WARN "couldn't register console driver\n"); put_tty_driver(viotty_driver); viotty_driver = NULL; } - if (tty_register_driver(viottyS_driver)) { - printk(VIOCONS_KERN_WARN "couldn't register console S driver\n"); - put_tty_driver(viottyS_driver); - viottyS_driver = NULL; - } - viocons_init_cfu_buffer(); unregister_console(&viocons_early); _