summaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/digi_acceleport.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-02-02 14:28:57 +1100
committerLinus Torvalds <torvalds@linux-foundation.org>2008-02-02 14:28:57 +1100
commitb6cf160c4b788a31f6a4017a469b956ca77febf4 (patch)
treed4d525000e283fe08905385d91dd0170454eae9a /drivers/usb/serial/digi_acceleport.c
parented50d6cbc394cd0966469d3e249353c9dd1d38b9 (diff)
parent2c044a4803804708984931bcbd03314732e995d5 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (128 commits) USB: fix codingstyle issues in drivers/usb/core/*.c USB: fix codingstyle issues in drivers/usb/core/message.c USB: fix codingstyle issues in drivers/usb/core/hcd-pci.c USB: fix codingstyle issues in drivers/usb/core/devio.c USB: fix codingstyle issues in drivers/usb/core/devices.c USB: fix codingstyle issues in drivers/usb/core/*.h USB: fix codingstyle issues in include/linux/usb/ USB: fix codingstyle issues in include/linux/usb.h USB: mark USB drivers as being GPL only USB: use a real vendor and product id for root hubs USB: mount options: fix usbfs USB: Fix usb_serial_driver structure for Kobil cardreader driver. usb: ehci should use u16 for isochronous intervals usb: ehci, remove false clear-reset path USB: Use menuconfig objects usb: ohci-sm501 driver usb: dma bounce buffer support USB: last abuses of intfdata in close for usb-serial drivers USB: kl5kusb105 don't flush to logically disconnected devices USB: oti6858: cleanup ...
Diffstat (limited to 'drivers/usb/serial/digi_acceleport.c')
-rw-r--r--drivers/usb/serial/digi_acceleport.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c
index ae410c4678e..5f9c6e46bee 100644
--- a/drivers/usb/serial/digi_acceleport.c
+++ b/drivers/usb/serial/digi_acceleport.c
@@ -1405,19 +1405,19 @@ static void digi_close(struct usb_serial_port *port, struct file *filp)
unsigned char buf[32];
struct tty_struct *tty = port->tty;
struct digi_port *priv = usb_get_serial_port_data(port);
- unsigned long flags = 0;
dbg("digi_close: TOP: port=%d, open_count=%d",
priv->dp_port_num, port->open_count);
+ mutex_lock(&port->serial->disc_mutex);
/* if disconnected, just clear flags */
- if (!usb_get_intfdata(port->serial->interface))
+ if (port->serial->disconnected)
goto exit;
/* do cleanup only after final close on this port */
- spin_lock_irqsave(&priv->dp_port_lock, flags);
+ spin_lock_irq(&priv->dp_port_lock);
priv->dp_in_close = 1;
- spin_unlock_irqrestore(&priv->dp_port_lock, flags);
+ spin_unlock_irq(&priv->dp_port_lock);
/* tell line discipline to process only XON/XOFF */
tty->closing = 1;
@@ -1482,11 +1482,12 @@ static void digi_close(struct usb_serial_port *port, struct file *filp)
}
tty->closing = 0;
exit:
- spin_lock_irqsave(&priv->dp_port_lock, flags);
+ spin_lock_irq(&priv->dp_port_lock);
priv->dp_write_urb_in_use = 0;
priv->dp_in_close = 0;
wake_up_interruptible(&priv->dp_close_wait);
- spin_unlock_irqrestore(&priv->dp_port_lock, flags);
+ spin_unlock_irq(&priv->dp_port_lock);
+ mutex_unlock(&port->serial->disc_mutex);
dbg("digi_close: done");
}