summaryrefslogtreecommitdiffstats
path: root/drivers/staging/usbip/stub_rx.c
diff options
context:
space:
mode:
authorArnd Bergmann2011-03-02 00:13:05 +0100
committerGreg Kroah-Hartman2011-03-02 22:03:59 +0100
commit9720b4bc76a83807c68e00c62bfba575251bb73e (patch)
tree41794e9b5f715bf5ee52d428cadcf70ac773347b /drivers/staging/usbip/stub_rx.c
parentStaging: vt6656: Clean up switching to power saving mode. (diff)
downloadkernel-qcow2-linux-9720b4bc76a83807c68e00c62bfba575251bb73e.tar.gz
kernel-qcow2-linux-9720b4bc76a83807c68e00c62bfba575251bb73e.tar.xz
kernel-qcow2-linux-9720b4bc76a83807c68e00c62bfba575251bb73e.zip
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/stub_rx.c')
-rw-r--r--drivers/staging/usbip/stub_rx.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/staging/usbip/stub_rx.c b/drivers/staging/usbip/stub_rx.c
index ae6ac82754a4..6445f12cb4fd 100644
--- a/drivers/staging/usbip/stub_rx.c
+++ b/drivers/staging/usbip/stub_rx.c
@@ -18,6 +18,7 @@
*/
#include <linux/slab.h>
+#include <linux/kthread.h>
#include "usbip_common.h"
#include "stub.h"
@@ -616,19 +617,15 @@ static void stub_rx_pdu(struct usbip_device *ud)
}
-void stub_rx_loop(struct usbip_task *ut)
+int stub_rx_loop(void *data)
{
- struct usbip_device *ud = container_of(ut, struct usbip_device, tcp_rx);
-
- while (1) {
- if (signal_pending(current)) {
- usbip_dbg_stub_rx("signal caught!\n");
- break;
- }
+ struct usbip_device *ud = data;
+ while (!kthread_should_stop()) {
if (usbip_event_happened(ud))
break;
stub_rx_pdu(ud);
}
+ return 0;
}