提交 f561de33 编写于 作者: H hayeswang 提交者: David S. Miller

r8152: fix setting RTL8152_UNPLUG

The flag of RTL8152_UNPLUG should only be set when the device is
unplugged, not each time the rtl8152_disconnect() is called.
Otherwise, the device wouldn't be stopped normally.
Signed-off-by: NHayes Wang <hayeswang@realtek.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 37b9a267
...@@ -3576,7 +3576,11 @@ static void rtl8152_disconnect(struct usb_interface *intf) ...@@ -3576,7 +3576,11 @@ static void rtl8152_disconnect(struct usb_interface *intf)
usb_set_intfdata(intf, NULL); usb_set_intfdata(intf, NULL);
if (tp) { if (tp) {
struct usb_device *udev = tp->udev;
if (udev->state == USB_STATE_NOTATTACHED)
set_bit(RTL8152_UNPLUG, &tp->flags); set_bit(RTL8152_UNPLUG, &tp->flags);
tasklet_kill(&tp->tl); tasklet_kill(&tp->tl);
unregister_netdev(tp->netdev); unregister_netdev(tp->netdev);
tp->rtl_ops.unload(tp); tp->rtl_ops.unload(tp);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册