staging/usbip: convert to kthread
[deliverable/linux.git] / drivers / staging / usbip / vhci_rx.c
index bf69914709410cf054825933a638b7dd7060180a..09bf2355934bb6834e67641ab679faec43e88818 100644 (file)
@@ -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;
+}
This page took 0.028299 seconds and 5 git commands to generate.