Modifications to code using usbip_event.c

Initialization and termination of workqueue are added to init and exit 
routine of usbip_core respectively.

Signed-off-by: Nobuo Iwata <nobuo.iw...@fujixerox.co.jp>
---
 drivers/usb/usbip/stub_dev.c     | 3 +--
 drivers/usb/usbip/usbip_common.c | 7 +++++++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/usbip/stub_dev.c b/drivers/usb/usbip/stub_dev.c
index a3ec49b..e286346 100644
--- a/drivers/usb/usbip/stub_dev.c
+++ b/drivers/usb/usbip/stub_dev.c
@@ -388,7 +388,6 @@ err_files:
 err_port:
        dev_set_drvdata(&udev->dev, NULL);
        usb_put_dev(udev);
-       kthread_stop_put(sdev->ud.eh);
 
        busid_priv->sdev = NULL;
        stub_device_free(sdev);
@@ -449,7 +448,7 @@ static void stub_disconnect(struct usb_device *udev)
        }
 
        /* If usb reset is called from event handler */
-       if (busid_priv->sdev->ud.eh == current)
+       if (usbip_in_eh(current))
                return;
 
        /* shutdown the current connection */
diff --git a/drivers/usb/usbip/usbip_common.c b/drivers/usb/usbip/usbip_common.c
index facaaf0..aec2d65c 100644
--- a/drivers/usb/usbip/usbip_common.c
+++ b/drivers/usb/usbip/usbip_common.c
@@ -758,12 +758,19 @@ EXPORT_SYMBOL_GPL(usbip_recv_xbuff);
 
 static int __init usbip_core_init(void)
 {
+       int ret;
+
        pr_info(DRIVER_DESC " v" USBIP_VERSION "\n");
+       ret = usbip_init_eh();
+       if (ret)
+               return ret;
+
        return 0;
 }
 
 static void __exit usbip_core_exit(void)
 {
+       usbip_finish_eh();
        return;
 }
 
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to