From d5c9ffc6c6d15d4f655236e26942a21ad61fe3ad Mon Sep 17 00:00:00 2001 From: Jeff Dike Date: Sat, 10 Feb 2007 01:44:08 -0800 Subject: [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 Cc: Paolo 'Blaisorblade' Giarrusso Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/um/include/line.h | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) (limited to 'arch/um/include/line.h') diff --git a/arch/um/include/line.h b/arch/um/include/line.h index a2486b4cc9fe..3477a858eaa9 100644 --- a/arch/um/include/line.h +++ b/arch/um/include/line.h @@ -15,19 +15,18 @@ #include "chan_user.h" #include "mconsole_kern.h" +/* There's only one modifiable field in this - .mc.list */ struct line_driver { - char *name; - char *device_name; - short major; - short minor_start; - short type; - short subtype; - int read_irq; - char *read_irq_name; - int write_irq; - char *write_irq_name; - char *symlink_from; - char *symlink_to; + const char *name; + const char *device_name; + const short major; + const short minor_start; + const short type; + const short subtype; + const int read_irq; + const char *read_irq_name; + const int write_irq; + const char *write_irq_name; struct mc_device mc; }; @@ -67,12 +66,6 @@ struct line { .lock = SPIN_LOCK_UNLOCKED, \ .driver = d } -struct lines { - int num; -}; - -#define LINES_INIT(n) { .num = n } - extern void line_close(struct tty_struct *tty, struct file * filp); extern int line_open(struct line *lines, struct tty_struct *tty); extern int line_setup(struct line *lines, unsigned int sizeof_lines, @@ -94,10 +87,9 @@ extern char *add_xterm_umid(char *base); extern int line_setup_irq(int fd, int input, int output, struct line *line, void *data); extern void line_close_chan(struct line *line); -extern struct tty_driver * line_register_devfs(struct lines *set, - struct line_driver *line_driver, - const struct tty_operations *driver, - struct line *lines, int nlines); +extern struct tty_driver *register_lines(struct line_driver *line_driver, + const struct tty_operations *driver, + struct line *lines, int nlines); extern void lines_init(struct line *lines, int nlines, struct chan_opts *opts); extern void close_lines(struct line *lines, int nlines); -- cgit v1.2.3-59-g8ed1b