Commit ffbf68f3 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] ppc64: iSeries virtual console cleanup (part 1)

From: Stephen Rothwell <sfr@canb.auug.org.au>

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
parent df96aa84
......@@ -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(struct console *c, int *index)
* 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 *tty, struct file *filp)
port = tty->index;
if (port >= VIOTTY_SERIAL_START)
port -= VIOTTY_SERIAL_START;
if ((port < 0) || (port >= VTTY_PORTS))
return -ENODEV;
......@@ -822,13 +817,6 @@ static void viotty_put_char(struct tty_struct *tty, unsigned char ch)
internal_write(pi, &ch, 1, NULL);
}
/*
* TTY flush_chars method
*/
static void viotty_flush_chars(struct tty_struct *tty)
{
}
/*
* TTY write_room method
*/
......@@ -867,17 +855,13 @@ static int viotty_write_room(struct tty_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_struct *tty, struct file *file,
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);
......
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