Gitweb: http://git.kernel.org/linus/ff8324df1187b7280e507c976777df76c73a1ef1
Commit: ff8324df1187b7280e507c976777df76c73a1ef1
Parent: 74556123e034c8337b69a3ebac2f3a5fc0a97032
Author: Alan Stern <stern@rowland.harvard.edu>
AuthorDate: Tue Sep 1 11:39:51 2009 -0400
Committer: Live-CD User <linux@linux.site>
CommitDate: Sat Sep 19 13:13:41 2009 -0700
usb-serial: add missing tests and debug lines
This patch (as1290) adds some missing tests. serial_down() isn't
supposed to do anything if the hardware hasn't been initialized, and
serial_close() isn't supposed to do anything if the tty has gotten a
hangup (because serial_hangup() takes care of shutting down the
hardware).
The patch also updates and adds a few debugging lines.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/usb/serial/usb-serial.c | 21 +++++++++++++++++----
1 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index 28125de..9a32580 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -200,6 +200,8 @@ static int serial_install(struct tty_driver *driver, struct tty_struct *tty)
struct usb_serial_port *port;
int retval = -ENODEV;
+ dbg("%s", __func__);
+
serial = usb_serial_get_by_index(idx);
if (!serial)
return retval;
@@ -250,11 +252,11 @@ static int serial_open (struct tty_struct *tty, struct file *filp)
int retval = 0;
int first = 0;
- dbg("%s", __func__);
-
port = tty->driver_data;
serial = port->serial;
+ dbg("%s - port %d", __func__, port->number);
+
if (mutex_lock_interruptible(&port->mutex))
return -ERESTARTSYS;
@@ -315,6 +317,12 @@ static void serial_down(struct usb_serial_port *port)
if (port->console)
return;
+ /* Don't call the close method if the hardware hasn't ...