diff options
author | Arnd Bergmann <arnd@arndb.de> | 2011-03-02 00:13:05 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-03-02 16:03:59 -0500 |
commit | 9720b4bc76a83807c68e00c62bfba575251bb73e (patch) | |
tree | 41794e9b5f715bf5ee52d428cadcf70ac773347b /drivers/staging/usbip/vhci_rx.c | |
parent | 8c81161615feb8c666c675ec7a660dc9b011683f (diff) | |
download | op-kernel-dev-9720b4bc76a83807c68e00c62bfba575251bb73e.zip op-kernel-dev-9720b4bc76a83807c68e00c62bfba575251bb73e.tar.gz |
staging/usbip: convert to kthread
usbip has its own infrastructure for managing kernel
threads, similar to kthread. By changing it to use
the standard functions, we can simplify the code
and get rid of one of the last BKL users at the
same time.
Includes changes suggested by Max Vozeler.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Takahiro Hirofuchi <hirofuchi@users.sourceforge.net>
Cc: Max Vozeler <max@vozeler.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/usbip/vhci_rx.c')
-rw-r--r-- | drivers/staging/usbip/vhci_rx.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/staging/usbip/vhci_rx.c b/drivers/staging/usbip/vhci_rx.c index bf69914..09bf235 100644 --- a/drivers/staging/usbip/vhci_rx.c +++ b/drivers/staging/usbip/vhci_rx.c @@ -18,6 +18,7 @@ */ #include <linux/slab.h> +#include <linux/kthread.h> #include "usbip_common.h" #include "vhci.h" @@ -269,22 +270,17 @@ static void vhci_rx_pdu(struct usbip_device *ud) /*-------------------------------------------------------------------------*/ -void vhci_rx_loop(struct usbip_task *ut) +int vhci_rx_loop(void *data) { - struct usbip_device *ud = container_of(ut, struct usbip_device, tcp_rx); - - - while (1) { - if (signal_pending(current)) { - usbip_dbg_vhci_rx("signal catched!\n"); - break; - } + struct usbip_device *ud = data; + while (!kthread_should_stop()) { if (usbip_event_happened(ud)) break; vhci_rx_pdu(ud); } -} + return 0; +} |