summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/realtek
diff options
context:
space:
mode:
authorJes Sorensen2016-09-09 20:01:24 +0200
committerKalle Valo2016-09-14 19:01:08 +0200
commit54cdf5c727cb3d3124e61433a13e9724a7a4a952 (patch)
tree71851557aa64c3a335669173c6ef1ea9eeb54c98 /drivers/net/wireless/realtek
parentmwifiex: correction in Rx STBC field of htcapinfo (diff)
downloadkernel-qcow2-linux-54cdf5c727cb3d3124e61433a13e9724a7a4a952.tar.gz
kernel-qcow2-linux-54cdf5c727cb3d3124e61433a13e9724a7a4a952.tar.xz
kernel-qcow2-linux-54cdf5c727cb3d3124e61433a13e9724a7a4a952.zip
rtl8xxxu: Reset device on module unload if still attached
If the USB dongle is still attached, reset it on module unload to avoid scans failing when reloading the driver. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/realtek')
-rw-r--r--drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
index c3620833db7a..d2611a49a26d 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
@@ -6129,6 +6129,11 @@ static void rtl8xxxu_disconnect(struct usb_interface *interface)
mutex_destroy(&priv->usb_buf_mutex);
mutex_destroy(&priv->h2c_mutex);
+ if (priv->udev->state != USB_STATE_NOTATTACHED) {
+ dev_info(&priv->udev->dev,
+ "Device still attached, trying to reset\n");
+ usb_reset_device(priv->udev);
+ }
usb_put_dev(priv->udev);
ieee80211_free_hw(hw);
}