]> Pileus Git - ~andy/linux/blobdiff - drivers/staging/usbip/vhci_hcd.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux...
[~andy/linux] / drivers / staging / usbip / vhci_hcd.c
index a6143781e2a5dd4717692802b722914c7693f89a..c3aa2195f1a8b835ac00b5ebf32db8d130a3d4d0 100644 (file)
@@ -18,6 +18,7 @@
  */
 
 #include <linux/init.h>
+#include <linux/file.h>
 #include <linux/kernel.h>
 #include <linux/kthread.h>
 #include <linux/module.h>
@@ -804,8 +805,8 @@ static void vhci_shutdown_connection(struct usbip_device *ud)
        pr_info("stop threads\n");
 
        /* active connection is closed */
-       if (vdev->ud.tcp_socket != NULL) {
-               sock_release(vdev->ud.tcp_socket);
+       if (vdev->ud.tcp_socket) {
+               fput(vdev->ud.tcp_socket->file);
                vdev->ud.tcp_socket = NULL;
        }
        pr_info("release socket\n");
@@ -851,7 +852,10 @@ static void vhci_device_reset(struct usbip_device *ud)
                usb_put_dev(vdev->udev);
        vdev->udev = NULL;
 
-       ud->tcp_socket = NULL;
+       if (ud->tcp_socket) {
+               fput(ud->tcp_socket->file);
+               ud->tcp_socket = NULL;
+       }
        ud->status = VDEV_ST_NULL;
 
        spin_unlock(&ud->lock);
@@ -907,7 +911,6 @@ static int vhci_start(struct usb_hcd *hcd)
        spin_lock_init(&vhci->lock);
 
        hcd->power_budget = 0; /* no limit */
-       hcd->state  = HC_STATE_RUNNING;
        hcd->uses_new_polling = 1;
 
        /* vhci_hcd is now ready to be controlled through sysfs */
@@ -1124,7 +1127,7 @@ static int vhci_hcd_resume(struct platform_device *pdev)
 
 static struct platform_driver vhci_driver = {
        .probe  = vhci_hcd_probe,
-       .remove = __devexit_p(vhci_hcd_remove),
+       .remove = vhci_hcd_remove,
        .suspend = vhci_hcd_suspend,
        .resume = vhci_hcd_resume,
        .driver = {