diff options
Diffstat (limited to 'drivers/usb/serial/aircable.c')
-rw-r--r-- | drivers/usb/serial/aircable.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/usb/serial/aircable.c b/drivers/usb/serial/aircable.c index 812275509137..2a4ac9bd6a3a 100644 --- a/drivers/usb/serial/aircable.c +++ b/drivers/usb/serial/aircable.c | |||
@@ -92,6 +92,7 @@ struct aircable_private { | |||
92 | struct circ_buf *rx_buf; /* read buffer */ | 92 | struct circ_buf *rx_buf; /* read buffer */ |
93 | int rx_flags; /* for throttilng */ | 93 | int rx_flags; /* for throttilng */ |
94 | struct work_struct rx_work; /* work cue for the receiving line */ | 94 | struct work_struct rx_work; /* work cue for the receiving line */ |
95 | struct usb_serial_port *port; /* USB port with which associated */ | ||
95 | }; | 96 | }; |
96 | 97 | ||
97 | /* Private methods */ | 98 | /* Private methods */ |
@@ -251,10 +252,11 @@ static void aircable_send(struct usb_serial_port *port) | |||
251 | schedule_work(&port->work); | 252 | schedule_work(&port->work); |
252 | } | 253 | } |
253 | 254 | ||
254 | static void aircable_read(void *params) | 255 | static void aircable_read(struct work_struct *work) |
255 | { | 256 | { |
256 | struct usb_serial_port *port = params; | 257 | struct aircable_private *priv = |
257 | struct aircable_private *priv = usb_get_serial_port_data(port); | 258 | container_of(work, struct aircable_private, rx_work); |
259 | struct usb_serial_port *port = priv->port; | ||
258 | struct tty_struct *tty; | 260 | struct tty_struct *tty; |
259 | unsigned char *data; | 261 | unsigned char *data; |
260 | int count; | 262 | int count; |
@@ -348,7 +350,8 @@ static int aircable_attach (struct usb_serial *serial) | |||
348 | } | 350 | } |
349 | 351 | ||
350 | priv->rx_flags &= ~(THROTTLED | ACTUALLY_THROTTLED); | 352 | priv->rx_flags &= ~(THROTTLED | ACTUALLY_THROTTLED); |
351 | INIT_WORK(&priv->rx_work, aircable_read, port); | 353 | priv->port = port; |
354 | INIT_WORK(&priv->rx_work, aircable_read); | ||
352 | 355 | ||
353 | usb_set_serial_port_data(serial->port[0], priv); | 356 | usb_set_serial_port_data(serial->port[0], priv); |
354 | 357 | ||
@@ -515,7 +518,7 @@ static void aircable_read_bulk_callback(struct urb *urb) | |||
515 | package_length - shift); | 518 | package_length - shift); |
516 | } | 519 | } |
517 | } | 520 | } |
518 | aircable_read(port); | 521 | aircable_read(&priv->rx_work); |
519 | } | 522 | } |
520 | 523 | ||
521 | /* Schedule the next read _if_ we are still open */ | 524 | /* Schedule the next read _if_ we are still open */ |