diff options
author | Jia-Ju Bai <baijiaju1990@gmail.com> | 2018-04-10 20:25:09 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-04-23 15:51:34 +0200 |
commit | 6c93c63a634ae7036d699a1e7f2121a9f2dee5fe (patch) | |
tree | 53bc78957fd9024bb231cf2e36161f28bd1dbad9 | |
parent | a40c973eebe61aa9242f5501d5d5598778e3bea2 (diff) | |
download | linux-stable-6c93c63a634ae7036d699a1e7f2121a9f2dee5fe.tar.gz linux-stable-6c93c63a634ae7036d699a1e7f2121a9f2dee5fe.tar.bz2 linux-stable-6c93c63a634ae7036d699a1e7f2121a9f2dee5fe.zip |
staging: rtl8192u: Replace mdelay with usleep_range in rtl8192_usb_disconnect
rtl8192_usb_disconnect() is never called in atomic context.
rtl8192_usb_disconnect() is only set as ".disconnect" in
struct usb_driver.
Despite never getting called from atomic context,
rtl8192_usb_disconnect() calls mdelay() to busily wait.
This is not necessary and can be replaced with usleep_range() to
avoid busy waiting.
This is found by a static analysis tool named DCNS written by myself.
And I also manually check it.
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/rtl8192u/r8192U_core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index d607c59761cf..532a71364b34 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -5035,7 +5035,7 @@ static void rtl8192_usb_disconnect(struct usb_interface *intf) kfree(priv->pFirmware); priv->pFirmware = NULL; rtl8192_usb_deleteendpoints(dev); - mdelay(10); + usleep_range(10000, 11000); } free_ieee80211(dev); RT_TRACE(COMP_DOWN, "wlan driver removed\n"); |