diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-09-09 19:45:42 -0400 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2012-03-24 19:29:53 -0400 |
commit | cfe6b7c79daa0efa27f474f1fe2a88fd7af5cc47 (patch) | |
tree | 5030f25d83451e3b3e579bac4b9a2e561990048d /arch/um/drivers/line.h | |
parent | 31efcebb7d7196adcee73027f513d7c0bf572b47 (diff) |
um: switch line.c tty drivers to dynamic device creation
Current code doesn't update the symlinks in /sys/dev/char when we add/remove
tty lines. Fixing that allows to stop messing with ->valid before the driver
registration, which is a Good Thing(tm) - we shouldn't have it set before we
really have the things set up and ready for line_open().
We need tty_driver available to call tty_{un,}register_device(), so we just
stash a reference to it into struct line_driver.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/um/drivers/line.h')
-rw-r--r-- | arch/um/drivers/line.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/um/drivers/line.h b/arch/um/drivers/line.h index 471f477b271e..e3f86065e049 100644 --- a/arch/um/drivers/line.h +++ b/arch/um/drivers/line.h | |||
@@ -15,7 +15,7 @@ | |||
15 | #include "chan_user.h" | 15 | #include "chan_user.h" |
16 | #include "mconsole_kern.h" | 16 | #include "mconsole_kern.h" |
17 | 17 | ||
18 | /* There's only one modifiable field in this - .mc.list */ | 18 | /* There's only two modifiable fields in this - .mc.list and .driver */ |
19 | struct line_driver { | 19 | struct line_driver { |
20 | const char *name; | 20 | const char *name; |
21 | const char *device_name; | 21 | const char *device_name; |
@@ -28,6 +28,7 @@ struct line_driver { | |||
28 | const int write_irq; | 28 | const int write_irq; |
29 | const char *write_irq_name; | 29 | const char *write_irq_name; |
30 | struct mc_device mc; | 30 | struct mc_device mc; |
31 | struct tty_driver *driver; | ||
31 | }; | 32 | }; |
32 | 33 | ||
33 | struct line { | 34 | struct line { |
@@ -78,9 +79,9 @@ extern char *add_xterm_umid(char *base); | |||
78 | extern int line_setup_irq(int fd, int input, int output, struct line *line, | 79 | extern int line_setup_irq(int fd, int input, int output, struct line *line, |
79 | void *data); | 80 | void *data); |
80 | extern void line_close_chan(struct line *line); | 81 | extern void line_close_chan(struct line *line); |
81 | extern struct tty_driver *register_lines(struct line_driver *line_driver, | 82 | extern int register_lines(struct line_driver *line_driver, |
82 | const struct tty_operations *driver, | 83 | const struct tty_operations *driver, |
83 | struct line *lines, int nlines); | 84 | struct line *lines, int nlines); |
84 | extern void lines_init(struct line *lines, int nlines, struct chan_opts *opts); | 85 | extern void lines_init(struct line *lines, int nlines, struct chan_opts *opts); |
85 | extern void close_lines(struct line *lines, int nlines); | 86 | extern void close_lines(struct line *lines, int nlines); |
86 | 87 | ||