aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorAlan Cox <alan@redhat.com>2008-10-13 05:39:46 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-13 12:51:41 -0400
commit4a90f09b20f4622dcbff1f0e1e6bae1704f8ad8c (patch)
tree9b275f88f2705cb10121d5982741aef3a088a7c8 /include/linux
parent95f9bfc6b76e862265a2d70ae061eec18fe14140 (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.h3
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
183struct tty_port { 183struct 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);
405extern void tty_port_init(struct tty_port *port); 406extern void tty_port_init(struct tty_port *port);
406extern int tty_port_alloc_xmit_buf(struct tty_port *port); 407extern int tty_port_alloc_xmit_buf(struct tty_port *port);
407extern void tty_port_free_xmit_buf(struct tty_port *port); 408extern void tty_port_free_xmit_buf(struct tty_port *port);
409extern struct tty_struct *tty_port_tty_get(struct tty_port *port);
410extern void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty);
408 411
409extern int tty_register_ldisc(int disc, struct tty_ldisc_ops *new_ldisc); 412extern int tty_register_ldisc(int disc, struct tty_ldisc_ops *new_ldisc);
410extern int tty_unregister_ldisc(int disc); 413extern int tty_unregister_ldisc(int disc);