aboutsummaryrefslogtreecommitdiff
path: root/arch/um/drivers/chan_kern.c
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2006-01-06 00:18:55 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-06 08:33:46 -0800
commit1f80171e81ed0d08dcdb6efe239d7b929aef498f (patch)
treef6f72268ddee265b46ceb698cdff6daa7cba6250 /arch/um/drivers/chan_kern.c
parent418e55d49b0ec7d2e7a033f2dd083f5b2ab7d119 (diff)
[PATCH] uml: move console configuration
This patch changes when console devices are configured in order to prepare the ground for the next patch. parse_chan_pair is now done earlier, when initcalls are run, rather than when the device is opened. When a host device disappears, the channel list is closed, but not freed. This is required by the previous change. line_config now takes the options structure as an argument, and line_open doesn't. Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/drivers/chan_kern.c')
-rw-r--r--arch/um/drivers/chan_kern.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/arch/um/drivers/chan_kern.c b/arch/um/drivers/chan_kern.c
index 59c9b3f7c84..31b69c4ea80 100644
--- a/arch/um/drivers/chan_kern.c
+++ b/arch/um/drivers/chan_kern.c
@@ -311,14 +311,12 @@ int console_write_chan(struct list_head *chans, const char *buf, int len)
int console_open_chan(struct line *line, struct console *co,
struct chan_opts *opts)
{
- if (!list_empty(&line->chan_list))
- return 0;
+ int err;
+
+ err = open_chan(&line->chan_list);
+ if(err)
+ return err;
- if (0 != parse_chan_pair(line->init_str, &line->chan_list,
- co->index, opts))
- return -1;
- if (0 != open_chan(&line->chan_list))
- return -1;
printk("Console initialized on /dev/%s%d\n",co->name,co->index);
return 0;
}
@@ -596,13 +594,11 @@ void chan_interrupt(struct list_head *chans, struct work_struct *task,
tty_hangup(tty);
line_disable(tty, irq);
close_chan(chans);
- free_chan(chans);
return;
}
else {
if(chan->ops->close != NULL)
chan->ops->close(chan->fd, chan->data);
- free_one_chan(chan);
}
}
}