Commit 2c9d6c2b authored by Oleksij Rempel's avatar Oleksij Rempel Committed by David S. Miller

usbnet: run unbind() before unregister_netdev()

unbind() is the proper place to disconnect PHY, but it will fail if
netdev is already unregistered.
Signed-off-by: default avatarOleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 06edf1a9
......@@ -1597,6 +1597,9 @@ void usbnet_disconnect (struct usb_interface *intf)
xdev->bus->bus_name, xdev->devpath,
dev->driver_info->description);
if (dev->driver_info->unbind)
dev->driver_info->unbind(dev, intf);
net = dev->net;
unregister_netdev (net);
......@@ -1604,9 +1607,6 @@ void usbnet_disconnect (struct usb_interface *intf)
usb_scuttle_anchored_urbs(&dev->deferred);
if (dev->driver_info->unbind)
dev->driver_info->unbind (dev, intf);
usb_kill_urb(dev->interrupt);
usb_free_urb(dev->interrupt);
kfree(dev->padding_pkt);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment