aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/keyspan_pda.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-03-16 18:04:26 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-16 18:04:26 -0400
commit971f115a50afbe409825c9f3399d5a3b9aca4381 (patch)
treecb42dc07a032e325f22b64d961587c081225c6d6 /drivers/usb/serial/keyspan_pda.c
parent2e270d84223262a38d4755c61d55f5c73ea89e56 (diff)
parent500132a0f26ad7d9916102193cbc6c1b1becb373 (diff)
Merge branch 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (172 commits) USB: Add support for SuperSpeed isoc endpoints xhci: Clean up cycle bit math used during stalls. xhci: Fix cycle bit calculation during stall handling. xhci: Update internal dequeue pointers after stalls. USB: Disable auto-suspend for USB 3.0 hubs. USB: Remove bogus USB_PORT_STAT_SUPER_SPEED symbol. xhci: Return canceled URBs immediately when host is halted. xhci: Fixes for suspend/resume of shared HCDs. xhci: Fix re-init on power loss after resume. xhci: Make roothub functions deal with device removal. xhci: Limit roothub ports to 15 USB3 & 31 USB2 ports. xhci: Return a USB 3.0 hub descriptor for USB3 roothub. xhci: Register second xHCI roothub. xhci: Change xhci_find_slot_id_by_port() API. xhci: Refactor bus suspend state into a struct. xhci: Index with a port array instead of PORTSC addresses. USB: Set usb_hcd->state and flags for shared roothubs. usb: Make core allocate resources per PCI-device. usb: Store bus type in usb_hcd, not in driver flags. usb: Change usb_hcd->bandwidth_mutex to a pointer. ...
Diffstat (limited to 'drivers/usb/serial/keyspan_pda.c')
-rw-r--r--drivers/usb/serial/keyspan_pda.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c
index 554a8693a463..7b690f3282a2 100644
--- a/drivers/usb/serial/keyspan_pda.c
+++ b/drivers/usb/serial/keyspan_pda.c
@@ -173,7 +173,8 @@ static void keyspan_pda_wakeup_write(struct work_struct *work)
173 container_of(work, struct keyspan_pda_private, wakeup_work); 173 container_of(work, struct keyspan_pda_private, wakeup_work);
174 struct usb_serial_port *port = priv->port; 174 struct usb_serial_port *port = priv->port;
175 struct tty_struct *tty = tty_port_tty_get(&port->port); 175 struct tty_struct *tty = tty_port_tty_get(&port->port);
176 tty_wakeup(tty); 176 if (tty)
177 tty_wakeup(tty);
177 tty_kref_put(tty); 178 tty_kref_put(tty);
178} 179}
179 180
@@ -206,7 +207,7 @@ static void keyspan_pda_request_unthrottle(struct work_struct *work)
206static void keyspan_pda_rx_interrupt(struct urb *urb) 207static void keyspan_pda_rx_interrupt(struct urb *urb)
207{ 208{
208 struct usb_serial_port *port = urb->context; 209 struct usb_serial_port *port = urb->context;
209 struct tty_struct *tty = tty_port_tty_get(&port->port); 210 struct tty_struct *tty;
210 unsigned char *data = urb->transfer_buffer; 211 unsigned char *data = urb->transfer_buffer;
211 int retval; 212 int retval;
212 int status = urb->status; 213 int status = urb->status;
@@ -223,7 +224,7 @@ static void keyspan_pda_rx_interrupt(struct urb *urb)
223 /* this urb is terminated, clean up */ 224 /* this urb is terminated, clean up */
224 dbg("%s - urb shutting down with status: %d", 225 dbg("%s - urb shutting down with status: %d",
225 __func__, status); 226 __func__, status);
226 goto out; 227 return;
227 default: 228 default:
228 dbg("%s - nonzero urb status received: %d", 229 dbg("%s - nonzero urb status received: %d",
229 __func__, status); 230 __func__, status);
@@ -233,12 +234,14 @@ static void keyspan_pda_rx_interrupt(struct urb *urb)
233 /* see if the message is data or a status interrupt */ 234 /* see if the message is data or a status interrupt */
234 switch (data[0]) { 235 switch (data[0]) {
235 case 0: 236 case 0:
236 /* rest of message is rx data */ 237 tty = tty_port_tty_get(&port->port);
237 if (urb->actual_length) { 238 /* rest of message is rx data */
239 if (tty && urb->actual_length) {
238 tty_insert_flip_string(tty, data + 1, 240 tty_insert_flip_string(tty, data + 1,
239 urb->actual_length - 1); 241 urb->actual_length - 1);
240 tty_flip_buffer_push(tty); 242 tty_flip_buffer_push(tty);
241 } 243 }
244 tty_kref_put(tty);
242 break; 245 break;
243 case 1: 246 case 1:
244 /* status interrupt */ 247 /* status interrupt */
@@ -265,8 +268,6 @@ exit:
265 dev_err(&port->dev, 268 dev_err(&port->dev,
266 "%s - usb_submit_urb failed with result %d", 269 "%s - usb_submit_urb failed with result %d",
267 __func__, retval); 270 __func__, retval);
268out:
269 tty_kref_put(tty);
270} 271}
271 272
272 273