summaryrefslogtreecommitdiffstats
path: root/arch/um/drivers/stdio_console.c
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2007-02-10 01:44:08 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-11 10:51:22 -0800
commitd5c9ffc6c6d15d4f655236e26942a21ad61fe3ad (patch)
tree0fda7f4a171461ab95bb424f158949d53f223920 /arch/um/drivers/stdio_console.c
parentb4ac91a0eac36f347a509afda07e4305e931de61 (diff)
downloadblackbird-op-linux-d5c9ffc6c6d15d4f655236e26942a21ad61fe3ad.tar.gz
blackbird-op-linux-d5c9ffc6c6d15d4f655236e26942a21ad61fe3ad.zip
[PATCH] uml: console locking commentary and code cleanup
Remove the last vestiges of devfs from console registration. Change the name of the function, plus remove a couple of unused fields from the line_driver structure. struct lines is no longer needed, all traces of it are gone. The only way that I can see to mark a structure as being almost-const is to individually const the fields. This is the case for the line_driver structure, which has only one modifiable field - a list_head in a sub-structure. Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/drivers/stdio_console.c')
-rw-r--r--arch/um/drivers/stdio_console.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/arch/um/drivers/stdio_console.c b/arch/um/drivers/stdio_console.c
index a83c42c263b3..8dccdd193d94 100644
--- a/arch/um/drivers/stdio_console.c
+++ b/arch/um/drivers/stdio_console.c
@@ -55,6 +55,8 @@ static int con_config(char *str, char **error_out);
static int con_get_config(char *dev, char *str, int size, char **error_out);
static int con_remove(int n, char **con_remove);
+
+/* Const, except for .mc.list */
static struct line_driver driver = {
.name = "UML console",
.device_name = "tty",
@@ -66,8 +68,6 @@ static struct line_driver driver = {
.read_irq_name = "console",
.write_irq = CONSOLE_WRITE_IRQ,
.write_irq_name = "console-write",
- .symlink_from = "ttys",
- .symlink_to = "vc",
.mc = {
.name = "con",
.config = con_config,
@@ -77,10 +77,8 @@ static struct line_driver driver = {
},
};
-static struct lines console_lines = LINES_INIT(MAX_TTYS);
-
-/* The array is initialized by line_init, which is an initcall. The
- * individual elements are protected by individual semaphores.
+/* The array is initialized by line_init, at initcall time. The
+ * elements are locked individually as needed.
*/
static struct line vts[MAX_TTYS] = { LINE_INIT(CONFIG_CON_ZERO_CHAN, &driver),
[ 1 ... MAX_TTYS - 1 ] =
@@ -148,6 +146,7 @@ static int uml_console_setup(struct console *co, char *options)
return console_open_chan(line, co);
}
+/* No locking for register_console call - relies on single-threaded initcalls */
static struct console stdiocons = {
.name = "tty",
.write = uml_console_write,
@@ -155,16 +154,14 @@ static struct console stdiocons = {
.setup = uml_console_setup,
.flags = CON_PRINTBUFFER,
.index = -1,
- .data = &vts,
};
int stdio_init(void)
{
char *new_title;
- console_driver = line_register_devfs(&console_lines, &driver,
- &console_ops, vts,
- ARRAY_SIZE(vts));
+ console_driver = register_lines(&driver, &console_ops, vts,
+ ARRAY_SIZE(vts));
if (console_driver == NULL)
return -1;
printk(KERN_INFO "Initialized stdio console driver\n");
OpenPOWER on IntegriCloud