aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/drivers/ssl.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/ssl.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/ssl.c')
-rw-r--r--arch/um/drivers/ssl.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/arch/um/drivers/ssl.c b/arch/um/drivers/ssl.c
index 475de52783e4..fc22b9bd9153 100644
--- a/arch/um/drivers/ssl.c
+++ b/arch/um/drivers/ssl.c
@@ -51,6 +51,8 @@ static int ssl_config(char *str, char **error_out);
51static int ssl_get_config(char *dev, char *str, int size, char **error_out); 51static int ssl_get_config(char *dev, char *str, int size, char **error_out);
52static int ssl_remove(int n, char **error_out); 52static int ssl_remove(int n, char **error_out);
53 53
54
55/* Const, except for .mc.list */
54static struct line_driver driver = { 56static struct line_driver driver = {
55 .name = "UML serial line", 57 .name = "UML serial line",
56 .device_name = "ttyS", 58 .device_name = "ttyS",
@@ -62,8 +64,6 @@ static struct line_driver driver = {
62 .read_irq_name = "ssl", 64 .read_irq_name = "ssl",
63 .write_irq = SSL_WRITE_IRQ, 65 .write_irq = SSL_WRITE_IRQ,
64 .write_irq_name = "ssl-write", 66 .write_irq_name = "ssl-write",
65 .symlink_from = "serial",
66 .symlink_to = "tts",
67 .mc = { 67 .mc = {
68 .list = LIST_HEAD_INIT(driver.mc.list), 68 .list = LIST_HEAD_INIT(driver.mc.list),
69 .name = "ssl", 69 .name = "ssl",
@@ -74,14 +74,12 @@ static struct line_driver driver = {
74 }, 74 },
75}; 75};
76 76
77/* The array is initialized by line_init, which is an initcall. The 77/* The array is initialized by line_init, at initcall time. The
78 * individual elements are protected by individual semaphores. 78 * elements are locked individually as needed.
79 */ 79 */
80static struct line serial_lines[NR_PORTS] = 80static struct line serial_lines[NR_PORTS] =
81 { [0 ... NR_PORTS - 1] = LINE_INIT(CONFIG_SSL_CHAN, &driver) }; 81 { [0 ... NR_PORTS - 1] = LINE_INIT(CONFIG_SSL_CHAN, &driver) };
82 82
83static struct lines lines = LINES_INIT(NR_PORTS);
84
85static int ssl_config(char *str, char **error_out) 83static int ssl_config(char *str, char **error_out)
86{ 84{
87 return line_config(serial_lines, ARRAY_SIZE(serial_lines), str, &opts, 85 return line_config(serial_lines, ARRAY_SIZE(serial_lines), str, &opts,
@@ -175,6 +173,7 @@ static int ssl_console_setup(struct console *co, char *options)
175 return console_open_chan(line, co); 173 return console_open_chan(line, co);
176} 174}
177 175
176/* No locking for register_console call - relies on single-threaded initcalls */
178static struct console ssl_cons = { 177static struct console ssl_cons = {
179 .name = "ttyS", 178 .name = "ttyS",
180 .write = ssl_console_write, 179 .write = ssl_console_write,
@@ -190,9 +189,8 @@ static int ssl_init(void)
190 189
191 printk(KERN_INFO "Initializing software serial port version %d\n", 190 printk(KERN_INFO "Initializing software serial port version %d\n",
192 ssl_version); 191 ssl_version);
193 ssl_driver = line_register_devfs(&lines, &driver, &ssl_ops, 192 ssl_driver = register_lines(&driver, &ssl_ops, serial_lines,
194 serial_lines, 193 ARRAY_SIZE(serial_lines));
195 ARRAY_SIZE(serial_lines));
196 194
197 lines_init(serial_lines, ARRAY_SIZE(serial_lines), &opts); 195 lines_init(serial_lines, ARRAY_SIZE(serial_lines), &opts);
198 196