aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/drivers/stdio_console.c
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2007-02-10 04:44:08 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-11 13:51:22 -0500
commitd5c9ffc6c6d15d4f655236e26942a21ad61fe3ad (patch)
tree0fda7f4a171461ab95bb424f158949d53f223920 /arch/um/drivers/stdio_console.c
parentb4ac91a0eac36f347a509afda07e4305e931de61 (diff)
[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);
55static int con_get_config(char *dev, char *str, int size, char **error_out); 55static int con_get_config(char *dev, char *str, int size, char **error_out);
56static int con_remove(int n, char **con_remove); 56static int con_remove(int n, char **con_remove);
57 57
58
59/* Const, except for .mc.list */
58static struct line_driver driver = { 60static struct line_driver driver = {
59 .name = "UML console", 61 .name = "UML console",
60 .device_name = "tty", 62 .device_name = "tty",
@@ -66,8 +68,6 @@ static struct line_driver driver = {
66 .read_irq_name = "console", 68 .read_irq_name = "console",
67 .write_irq = CONSOLE_WRITE_IRQ, 69 .write_irq = CONSOLE_WRITE_IRQ,
68 .write_irq_name = "console-write", 70 .write_irq_name = "console-write",
69 .symlink_from = "ttys",
70 .symlink_to = "vc",
71 .mc = { 71 .mc = {
72 .name = "con", 72 .name = "con",
73 .config = con_config, 73 .config = con_config,
@@ -77,10 +77,8 @@ static struct line_driver driver = {
77 }, 77 },
78}; 78};
79 79
80static struct lines console_lines = LINES_INIT(MAX_TTYS); 80/* The array is initialized by line_init, at initcall time. The
81 81 * elements are locked individually as needed.
82/* The array is initialized by line_init, which is an initcall. The
83 * individual elements are protected by individual semaphores.
84 */ 82 */
85static struct line vts[MAX_TTYS] = { LINE_INIT(CONFIG_CON_ZERO_CHAN, &driver), 83static struct line vts[MAX_TTYS] = { LINE_INIT(CONFIG_CON_ZERO_CHAN, &driver),
86 [ 1 ... MAX_TTYS - 1 ] = 84 [ 1 ... MAX_TTYS - 1 ] =
@@ -148,6 +146,7 @@ static int uml_console_setup(struct console *co, char *options)
148 return console_open_chan(line, co); 146 return console_open_chan(line, co);
149} 147}
150 148
149/* No locking for register_console call - relies on single-threaded initcalls */
151static struct console stdiocons = { 150static struct console stdiocons = {
152 .name = "tty", 151 .name = "tty",
153 .write = uml_console_write, 152 .write = uml_console_write,
@@ -155,16 +154,14 @@ static struct console stdiocons = {
155 .setup = uml_console_setup, 154 .setup = uml_console_setup,
156 .flags = CON_PRINTBUFFER, 155 .flags = CON_PRINTBUFFER,
157 .index = -1, 156 .index = -1,
158 .data = &vts,
159}; 157};
160 158
161int stdio_init(void) 159int stdio_init(void)
162{ 160{
163 char *new_title; 161 char *new_title;
164 162
165 console_driver = line_register_devfs(&console_lines, &driver, 163 console_driver = register_lines(&driver, &console_ops, vts,
166 &console_ops, vts, 164 ARRAY_SIZE(vts));
167 ARRAY_SIZE(vts));
168 if (console_driver == NULL) 165 if (console_driver == NULL)
169 return -1; 166 return -1;
170 printk(KERN_INFO "Initialized stdio console driver\n"); 167 printk(KERN_INFO "Initialized stdio console driver\n");