diff options
author | Jakub Kicinski <kubakici@wp.pl> | 2015-06-02 22:11:27 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2015-06-08 14:28:07 +0300 |
commit | 9a15b57e9a2c591a812d979fa3f4f1a763533636 (patch) | |
tree | 480bf491c9fc18299d29a38c26c41076c7830332 /drivers/net/wireless/mediatek/mt7601u/usb.c | |
parent | 2af6d21fce9990630d2adfda5a329706aa9e3571 (diff) | |
download | linux-9a15b57e9a2c591a812d979fa3f4f1a763533636.tar.xz |
mt7601u: don't cleanup device second time after .resume()
Make sure .disconnect() doesn't cleanup the device if
.resume() failed. This may happen when device is removed
during suspend.
Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt7601u/usb.c')
-rw-r--r-- | drivers/net/wireless/mediatek/mt7601u/usb.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/net/wireless/mediatek/mt7601u/usb.c b/drivers/net/wireless/mediatek/mt7601u/usb.c index 99e2b3997bfa..54dba4001865 100644 --- a/drivers/net/wireless/mediatek/mt7601u/usb.c +++ b/drivers/net/wireless/mediatek/mt7601u/usb.c @@ -338,8 +338,15 @@ static int mt7601u_suspend(struct usb_interface *usb_intf, pm_message_t state) static int mt7601u_resume(struct usb_interface *usb_intf) { struct mt7601u_dev *dev = usb_get_intfdata(usb_intf); + int ret; + + ret = mt7601u_init_hardware(dev); + if (ret) + return ret; + + set_bit(MT7601U_STATE_INITIALIZED, &dev->state); - return mt7601u_init_hardware(dev); + return 0; } MODULE_DEVICE_TABLE(usb, mt7601u_device_table); |