Skip to content

Commit

Permalink
usbnet:pegasus: 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 ef9d884 commit 5c2f051
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions drivers/net/usb/pegasus.c
Original file line number Diff line number Diff line change
Expand Up @@ -1329,8 +1329,6 @@ static int pegasus_probe(struct usb_interface *intf,
}
pegasus_count++;

usb_get_dev(dev);

net = alloc_etherdev(sizeof(struct pegasus));
if (!net)
goto out;
Expand Down Expand Up @@ -1407,7 +1405,6 @@ static int pegasus_probe(struct usb_interface *intf,
out1:
free_netdev(net);
out:
usb_put_dev(dev);
pegasus_dec_workqueue();
return res;
}
Expand All @@ -1425,7 +1422,6 @@ static void pegasus_disconnect(struct usb_interface *intf)
pegasus->flags |= PEGASUS_UNPLUG;
cancel_delayed_work(&pegasus->carrier_check);
unregister_netdev(pegasus->net);
usb_put_dev(interface_to_usbdev(intf));
unlink_all_urbs(pegasus);
free_all_urbs(pegasus);
free_skb_pool(pegasus);
Expand Down

0 comments on commit 5c2f051

Please sign in to comment.