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

usbnet:cdc-phonet: 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>
上级 5c2f0513
......@@ -394,7 +394,7 @@ int usbpn_probe(struct usb_interface *intf, const struct usb_device_id *id)
SET_NETDEV_DEV(dev, &intf->dev);
pnd->dev = dev;
pnd->usb = usb_get_dev(usbdev);
pnd->usb = usbdev;
pnd->intf = intf;
pnd->data_intf = data_intf;
spin_lock_init(&pnd->tx_lock);
......@@ -440,7 +440,6 @@ int usbpn_probe(struct usb_interface *intf, const struct usb_device_id *id)
static void usbpn_disconnect(struct usb_interface *intf)
{
struct usbpn_dev *pnd = usb_get_intfdata(intf);
struct usb_device *usb = pnd->usb;
if (pnd->disconnected)
return;
......@@ -449,7 +448,6 @@ static void usbpn_disconnect(struct usb_interface *intf)
usb_driver_release_interface(&usbpn_driver,
(pnd->intf == intf) ? pnd->data_intf : pnd->intf);
unregister_netdev(pnd->dev);
usb_put_dev(usb);
}
static struct usb_driver usbpn_driver = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册