Skip to content

Commit

Permalink
rtl8xxxu: Reset device on module unload if still attached
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jes Sorensen authored and Kalle Valo committed Sep 14, 2016
1 parent ae1799a commit 54cdf5c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 54cdf5c

Please sign in to comment.