[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>
This commit is contained in:
Jeff Dike
2007-02-10 01:44:08 -08:00
committed by Linus Torvalds
parent b4ac91a0ea
commit d5c9ffc6c6
4 changed files with 31 additions and 45 deletions

View File

@@ -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);