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 b1b5707bc99a..86bcf63b6ba5 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; |
@@ -349,7 +351,8 @@ static int aircable_attach (struct usb_serial *serial) | |||
349 | } | 351 | } |
350 | 352 | ||
351 | priv->rx_flags &= ~(THROTTLED | ACTUALLY_THROTTLED); | 353 | priv->rx_flags &= ~(THROTTLED | ACTUALLY_THROTTLED); |
352 | INIT_WORK(&priv->rx_work, aircable_read, port); | 354 | priv->port = port; |
355 | INIT_WORK(&priv->rx_work, aircable_read); | ||
353 | 356 | ||
354 | usb_set_serial_port_data(serial->port[0], priv); | 357 | usb_set_serial_port_data(serial->port[0], priv); |
355 | 358 | ||
@@ -516,7 +519,7 @@ static void aircable_read_bulk_callback(struct urb *urb) | |||
516 | package_length - shift); | 519 | package_length - shift); |
517 | } | 520 | } |
518 | } | 521 | } |
519 | aircable_read(port); | 522 | aircable_read(&priv->rx_work); |
520 | } | 523 | } |
521 | 524 | ||
522 | /* Schedule the next read _if_ we are still open */ | 525 | /* Schedule the next read _if_ we are still open */ |