aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/usbip/vhci_hcd.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2011-03-02 00:13:05 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2011-03-02 16:03:59 -0500
commit9720b4bc76a83807c68e00c62bfba575251bb73e (patch)
tree41794e9b5f715bf5ee52d428cadcf70ac773347b /drivers/staging/usbip/vhci_hcd.c
parent8c81161615feb8c666c675ec7a660dc9b011683f (diff)
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_hcd.c')
-rw-r--r--drivers/staging/usbip/vhci_hcd.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/staging/usbip/vhci_hcd.c b/drivers/staging/usbip/vhci_hcd.c
index a35fe61268d..36ae9fbd20a 100644
--- a/drivers/staging/usbip/vhci_hcd.c
+++ b/drivers/staging/usbip/vhci_hcd.c
@@ -18,6 +18,7 @@
*/
#include <linux/slab.h>
+#include <linux/kthread.h>
#include "usbip_common.h"
#include "vhci.h"
@@ -874,7 +875,10 @@ static void vhci_shutdown_connection(struct usbip_device *ud)
kernel_sock_shutdown(ud->tcp_socket, SHUT_RDWR);
}
- usbip_stop_threads(&vdev->ud);
+ /* kill threads related to this sdev, if v.c. exists */
+ kthread_stop(vdev->ud.tcp_rx);
+ kthread_stop(vdev->ud.tcp_tx);
+
usbip_uinfo("stop threads\n");
/* active connection is closed */
@@ -945,8 +949,8 @@ static void vhci_device_init(struct vhci_device *vdev)
{
memset(vdev, 0, sizeof(*vdev));
- usbip_task_init(&vdev->ud.tcp_rx, "vhci_rx", vhci_rx_loop);
- usbip_task_init(&vdev->ud.tcp_tx, "vhci_tx", vhci_tx_loop);
+ vdev->ud.tcp_rx = kthread_create(vhci_rx_loop, &vdev->ud, "vhci_rx");
+ vdev->ud.tcp_tx = kthread_create(vhci_tx_loop, &vdev->ud, "vhci_tx");
vdev->ud.side = USBIP_VHCI;
vdev->ud.status = VDEV_ST_NULL;