提交 5c2f0513 编写于 作者: T tom.leiming@gmail.com 提交者: David S. Miller

usbnet:pegasus: remove usb_get/put_dev in .probe and .disconnect

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: NMing Lei <tom.leiming@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 ef9d884d
......@@ -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;
......@@ -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;
}
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册