diff options
Diffstat (limited to 'drivers/usb/serial/whiteheat.c')
-rw-r--r-- | drivers/usb/serial/whiteheat.c | 33 |
1 files changed, 2 insertions, 31 deletions
diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c index 5335d3211c0..7c7295d09f3 100644 --- a/drivers/usb/serial/whiteheat.c +++ b/drivers/usb/serial/whiteheat.c | |||
@@ -147,8 +147,7 @@ static int whiteheat_attach(struct usb_serial *serial); | |||
147 | static void whiteheat_shutdown(struct usb_serial *serial); | 147 | static void whiteheat_shutdown(struct usb_serial *serial); |
148 | static int whiteheat_open(struct tty_struct *tty, | 148 | static int whiteheat_open(struct tty_struct *tty, |
149 | struct usb_serial_port *port, struct file *filp); | 149 | struct usb_serial_port *port, struct file *filp); |
150 | static void whiteheat_close(struct tty_struct *tty, | 150 | static void whiteheat_close(struct usb_serial_port *port); |
151 | struct usb_serial_port *port, struct file *filp); | ||
152 | static int whiteheat_write(struct tty_struct *tty, | 151 | static int whiteheat_write(struct tty_struct *tty, |
153 | struct usb_serial_port *port, | 152 | struct usb_serial_port *port, |
154 | const unsigned char *buf, int count); | 153 | const unsigned char *buf, int count); |
@@ -712,8 +711,7 @@ exit: | |||
712 | } | 711 | } |
713 | 712 | ||
714 | 713 | ||
715 | static void whiteheat_close(struct tty_struct *tty, | 714 | static void whiteheat_close(struct usb_serial_port *port) |
716 | struct usb_serial_port *port, struct file *filp) | ||
717 | { | 715 | { |
718 | struct whiteheat_private *info = usb_get_serial_port_data(port); | 716 | struct whiteheat_private *info = usb_get_serial_port_data(port); |
719 | struct whiteheat_urb_wrap *wrap; | 717 | struct whiteheat_urb_wrap *wrap; |
@@ -723,31 +721,7 @@ static void whiteheat_close(struct tty_struct *tty, | |||
723 | 721 | ||
724 | dbg("%s - port %d", __func__, port->number); | 722 | dbg("%s - port %d", __func__, port->number); |
725 | 723 | ||
726 | mutex_lock(&port->serial->disc_mutex); | ||
727 | /* filp is NULL when called from usb_serial_disconnect */ | ||
728 | if ((filp && (tty_hung_up_p(filp))) || port->serial->disconnected) { | ||
729 | mutex_unlock(&port->serial->disc_mutex); | ||
730 | return; | ||
731 | } | ||
732 | mutex_unlock(&port->serial->disc_mutex); | ||
733 | |||
734 | tty->closing = 1; | ||
735 | |||
736 | /* | ||
737 | * Not currently in use; tty_wait_until_sent() calls | ||
738 | * serial_chars_in_buffer() which deadlocks on the second semaphore | ||
739 | * acquisition. This should be fixed at some point. Greg's been | ||
740 | * notified. | ||
741 | if ((filp->f_flags & (O_NDELAY | O_NONBLOCK)) == 0) { | ||
742 | tty_wait_until_sent(tty, CLOSING_DELAY); | ||
743 | } | ||
744 | */ | ||
745 | |||
746 | tty_driver_flush_buffer(tty); | ||
747 | tty_ldisc_flush(tty); | ||
748 | |||
749 | firm_report_tx_done(port); | 724 | firm_report_tx_done(port); |
750 | |||
751 | firm_close(port); | 725 | firm_close(port); |
752 | 726 | ||
753 | /* shutdown our bulk reads and writes */ | 727 | /* shutdown our bulk reads and writes */ |
@@ -775,10 +749,7 @@ static void whiteheat_close(struct tty_struct *tty, | |||
775 | } | 749 | } |
776 | spin_unlock_irq(&info->lock); | 750 | spin_unlock_irq(&info->lock); |
777 | mutex_unlock(&info->deathwarrant); | 751 | mutex_unlock(&info->deathwarrant); |
778 | |||
779 | stop_command_port(port->serial); | 752 | stop_command_port(port->serial); |
780 | |||
781 | tty->closing = 0; | ||
782 | } | 753 | } |
783 | 754 | ||
784 | 755 | ||