diff options
author | Alan Cox <alan@redhat.com> | 2008-10-13 05:39:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-13 12:51:41 -0400 |
commit | 4a90f09b20f4622dcbff1f0e1e6bae1704f8ad8c (patch) | |
tree | 9b275f88f2705cb10121d5982741aef3a088a7c8 /include/linux | |
parent | 95f9bfc6b76e862265a2d70ae061eec18fe14140 (diff) |
tty: usb-serial krefs
Use kref in the USB serial drivers so that we don't free tty structures
from under the URB receive handlers as has historically been the case if
you were unlucky. This also gives us a framework for general tty drivers to
use tty_port objects and refcount.
Contains two err->dev_err changes merged together to fix clashes in the
-next tree.
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/tty.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h index b64d10b66548..c30ed8d3bcbd 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -182,6 +182,7 @@ struct signal_struct; | |||
182 | 182 | ||
183 | struct tty_port { | 183 | struct tty_port { |
184 | struct tty_struct *tty; /* Back pointer */ | 184 | struct tty_struct *tty; /* Back pointer */ |
185 | spinlock_t lock; /* Lock protecting tty field */ | ||
185 | int blocked_open; /* Waiting to open */ | 186 | int blocked_open; /* Waiting to open */ |
186 | int count; /* Usage count */ | 187 | int count; /* Usage count */ |
187 | wait_queue_head_t open_wait; /* Open waiters */ | 188 | wait_queue_head_t open_wait; /* Open waiters */ |
@@ -405,6 +406,8 @@ extern int tty_write_lock(struct tty_struct *tty, int ndelay); | |||
405 | extern void tty_port_init(struct tty_port *port); | 406 | extern void tty_port_init(struct tty_port *port); |
406 | extern int tty_port_alloc_xmit_buf(struct tty_port *port); | 407 | extern int tty_port_alloc_xmit_buf(struct tty_port *port); |
407 | extern void tty_port_free_xmit_buf(struct tty_port *port); | 408 | extern void tty_port_free_xmit_buf(struct tty_port *port); |
409 | extern struct tty_struct *tty_port_tty_get(struct tty_port *port); | ||
410 | extern void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty); | ||
408 | 411 | ||
409 | extern int tty_register_ldisc(int disc, struct tty_ldisc_ops *new_ldisc); | 412 | extern int tty_register_ldisc(int disc, struct tty_ldisc_ops *new_ldisc); |
410 | extern int tty_unregister_ldisc(int disc); | 413 | extern int tty_unregister_ldisc(int disc); |