diff options
author | Pete Zaitcev <zaitcev@redhat.com> | 2006-05-23 00:58:49 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-06-21 18:04:13 -0400 |
commit | cf2c7481d2ff7f0c266de873b2fe93883e9782f9 (patch) | |
tree | 35dba35b3969f431feb0dfe5732c3825aa077a22 /drivers/usb/serial/usb-serial.c | |
parent | ad93375a30334cd97a61f7076d242e1cfdb66abc (diff) |
[PATCH] USB serial: encapsulate schedule_work, remove double-calling
I'm going to throw schedule_work away, it's retarded. But for starters,
let's have it encapsulated.
Also, generic and whiteheat were both calling usb_serial_port_softint
and scheduled work. Only one was necessary.
Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial/usb-serial.c')
-rw-r--r-- | drivers/usb/serial/usb-serial.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 92200f05b531..7a1cc1b04979 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
@@ -531,7 +531,17 @@ exit: | |||
531 | return -EINVAL; | 531 | return -EINVAL; |
532 | } | 532 | } |
533 | 533 | ||
534 | void usb_serial_port_softint(void *private) | 534 | /* |
535 | * We would be calling tty_wakeup here, but unfortunately some line | ||
536 | * disciplines have an annoying habit of calling tty->write from | ||
537 | * the write wakeup callback (e.g. n_hdlc.c). | ||
538 | */ | ||
539 | void usb_serial_port_softint(struct usb_serial_port *port) | ||
540 | { | ||
541 | schedule_work(&port->work); | ||
542 | } | ||
543 | |||
544 | static void usb_serial_port_work(void *private) | ||
535 | { | 545 | { |
536 | struct usb_serial_port *port = private; | 546 | struct usb_serial_port *port = private; |
537 | struct tty_struct *tty; | 547 | struct tty_struct *tty; |
@@ -794,7 +804,7 @@ int usb_serial_probe(struct usb_interface *interface, | |||
794 | port->serial = serial; | 804 | port->serial = serial; |
795 | spin_lock_init(&port->lock); | 805 | spin_lock_init(&port->lock); |
796 | mutex_init(&port->mutex); | 806 | mutex_init(&port->mutex); |
797 | INIT_WORK(&port->work, usb_serial_port_softint, port); | 807 | INIT_WORK(&port->work, usb_serial_port_work, port); |
798 | serial->port[i] = port; | 808 | serial->port[i] = port; |
799 | } | 809 | } |
800 | 810 | ||