aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/usb_debug.c
diff options
context:
space:
mode:
authorAlan Cox <alan@redhat.com>2008-07-22 06:09:07 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-22 16:03:22 -0400
commit95da310e66ee8090119596c70ca8432e57f9a97f (patch)
tree7f18c30e9c9ad4d7d53df6453fa338be06f09a85 /drivers/usb/serial/usb_debug.c
parent1aa3692da57c773e5c76de55c5c4a953962d360e (diff)
usb_serial: API all change
USB serial likes to use port->tty back pointers for the real work it does and to do so without any actual locking. Unfortunately when you consider hangup events, hangup/parallel reopen or even worse hangup followed by parallel close events the tty->port and port->tty pointers are not guaranteed to be the same as port->tty is the active tty while tty->port is the port the tty may or may not still be attached to. So rework the entire API to pass the tty struct. For console cases we need to pass both for now. This shows up multiple drivers that immediately crash with USB console some of which have been fixed in the process. Longer term we need a proper tty as console abstraction Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/usb/serial/usb_debug.c')
-rw-r--r--drivers/usb/serial/usb_debug.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/serial/usb_debug.c b/drivers/usb/serial/usb_debug.c
index 9ca4d4db1ddd..fc5d9952b03b 100644
--- a/drivers/usb/serial/usb_debug.c
+++ b/drivers/usb/serial/usb_debug.c
@@ -31,10 +31,11 @@ static struct usb_driver debug_driver = {
31 .no_dynamic_id = 1, 31 .no_dynamic_id = 1,
32}; 32};
33 33
34int usb_debug_open(struct usb_serial_port *port, struct file *filp) 34int usb_debug_open(struct tty_struct *tty, struct usb_serial_port *port,
35 struct file *filp)
35{ 36{
36 port->bulk_out_size = USB_DEBUG_MAX_PACKET_SIZE; 37 port->bulk_out_size = USB_DEBUG_MAX_PACKET_SIZE;
37 return usb_serial_generic_open(port, filp); 38 return usb_serial_generic_open(tty, port, filp);
38} 39}
39 40
40static struct usb_serial_driver debug_device = { 41static struct usb_serial_driver debug_device = {