aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/keyspan_pda.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/keyspan_pda.c')
-rw-r--r--drivers/usb/serial/keyspan_pda.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c
index 040040a267d9..99e9a14c5bf6 100644
--- a/drivers/usb/serial/keyspan_pda.c
+++ b/drivers/usb/serial/keyspan_pda.c
@@ -172,8 +172,9 @@ static void keyspan_pda_wakeup_write(struct work_struct *work)
172 struct keyspan_pda_private *priv = 172 struct keyspan_pda_private *priv =
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 175 struct tty_struct *tty = tty_port_tty_get(&port->port);
176 tty_wakeup(port->port.tty); 176 tty_wakeup(tty);
177 tty_kref_put(tty);
177} 178}
178 179
179static void keyspan_pda_request_unthrottle(struct work_struct *work) 180static void keyspan_pda_request_unthrottle(struct work_struct *work)
@@ -205,7 +206,7 @@ static void keyspan_pda_request_unthrottle(struct work_struct *work)
205static void keyspan_pda_rx_interrupt(struct urb *urb) 206static void keyspan_pda_rx_interrupt(struct urb *urb)
206{ 207{
207 struct usb_serial_port *port = urb->context; 208 struct usb_serial_port *port = urb->context;
208 struct tty_struct *tty = port->port.tty; 209 struct tty_struct *tty = tty_port_tty_get(&port->port);
209 unsigned char *data = urb->transfer_buffer; 210 unsigned char *data = urb->transfer_buffer;
210 int retval; 211 int retval;
211 int status = urb->status; 212 int status = urb->status;
@@ -222,7 +223,7 @@ static void keyspan_pda_rx_interrupt(struct urb *urb)
222 /* this urb is terminated, clean up */ 223 /* this urb is terminated, clean up */
223 dbg("%s - urb shutting down with status: %d", 224 dbg("%s - urb shutting down with status: %d",
224 __func__, status); 225 __func__, status);
225 return; 226 goto out;
226 default: 227 default:
227 dbg("%s - nonzero urb status received: %d", 228 dbg("%s - nonzero urb status received: %d",
228 __func__, status); 229 __func__, status);
@@ -261,8 +262,11 @@ static void keyspan_pda_rx_interrupt(struct urb *urb)
261exit: 262exit:
262 retval = usb_submit_urb(urb, GFP_ATOMIC); 263 retval = usb_submit_urb(urb, GFP_ATOMIC);
263 if (retval) 264 if (retval)
264 err("%s - usb_submit_urb failed with result %d", 265 dev_err(&port->dev,
265 __func__, retval); 266 "%s - usb_submit_urb failed with result %d",
267 __func__, retval);
268out:
269 tty_kref_put(tty);
266} 270}
267 271
268 272