Skip to content

Commit

Permalink
usbnet: remove usb_get/put_dev in .probe and .disconnect
Browse files Browse the repository at this point in the history
usb_device is parent device of usb_interface in the view of driver
model, so its reference count is always held during .probe/.disconnect
of usb_interface instance.

This patch just removes the unnecessay usb_get/put_dev.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
tom.leiming@gmail.com authored and David S. Miller committed Jun 13, 2012
1 parent d0daebc commit ef9d884
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions drivers/net/usb/usbnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -1307,7 +1307,6 @@ void usbnet_disconnect (struct usb_interface *intf)
usb_free_urb(dev->interrupt);

free_netdev(net);
usb_put_dev (xdev);
}
EXPORT_SYMBOL_GPL(usbnet_disconnect);

Expand Down Expand Up @@ -1363,8 +1362,6 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
xdev = interface_to_usbdev (udev);
interface = udev->cur_altsetting;

usb_get_dev (xdev);

status = -ENOMEM;

// set up our own records
Expand Down Expand Up @@ -1493,7 +1490,6 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
out1:
free_netdev(net);
out:
usb_put_dev(xdev);
return status;
}
EXPORT_SYMBOL_GPL(usbnet_probe);
Expand Down

0 comments on commit ef9d884

Please sign in to comment.