diff options
author | hayeswang <hayeswang@realtek.com> | 2014-09-30 04:48:01 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-09-30 16:23:51 -0400 |
commit | f561de33d63aefb97fb0c3653a36fb32d4e8c74a (patch) | |
tree | 84af0838d17e75137ca62f5981a18003a885eb31 | |
parent | 37b9a2673cd24e389216770be24a064b6200a822 (diff) |
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: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/usb/r8152.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index e0394427e372..f68a4e6f45be 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c | |||
@@ -3576,7 +3576,11 @@ static void rtl8152_disconnect(struct usb_interface *intf) | |||
3576 | 3576 | ||
3577 | usb_set_intfdata(intf, NULL); | 3577 | usb_set_intfdata(intf, NULL); |
3578 | if (tp) { | 3578 | if (tp) { |
3579 | set_bit(RTL8152_UNPLUG, &tp->flags); | 3579 | struct usb_device *udev = tp->udev; |
3580 | |||
3581 | if (udev->state == USB_STATE_NOTATTACHED) | ||
3582 | set_bit(RTL8152_UNPLUG, &tp->flags); | ||
3583 | |||
3580 | tasklet_kill(&tp->tl); | 3584 | tasklet_kill(&tp->tl); |
3581 | unregister_netdev(tp->netdev); | 3585 | unregister_netdev(tp->netdev); |
3582 | tp->rtl_ops.unload(tp); | 3586 | tp->rtl_ops.unload(tp); |