staging: vt6656: call usb_device_reset before netdev registration
authorMalcolm Priestley <tvboxspy@gmail.com>
Tue, 22 Oct 2013 19:00:22 +0000 (20:00 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 27 Oct 2013 13:50:10 +0000 (06:50 -0700)
The USB reset occurs after netdev registration if network manager
calls device_open too fast causing USB fails in main_usb.c: device_init_registers.

Move the usb reset to before register_netdev.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6656/main_usb.c

index 5e4a5d0988d7ed9544a17a9274b7b777b2a8e0f5..aae228c533effe3a0a7f0f0460ec9ab8c9cb90e5 100644 (file)
@@ -723,14 +723,15 @@ vt6656_probe(struct usb_interface *intf, const struct usb_device_id *id)
        usb_set_intfdata(intf, pDevice);
        SET_NETDEV_DEV(netdev, &intf->dev);
        memcpy(pDevice->dev->dev_addr, fake_mac, ETH_ALEN);
+
+       usb_device_reset(pDevice);
+
        rc = register_netdev(netdev);
        if (rc) {
                printk(KERN_ERR DEVICE_NAME " Failed to register netdev\n");
                goto err_netdev;
        }
 
-       usb_device_reset(pDevice);
-
        return 0;
 
 err_netdev: