Skip to contentSkip to conversation

staging: rtl8723bs: replace msleep(10) with usleep_range()

PATCH In review Yash Mehla 2 participants 2 messages Mar 3 – Mar 5 Staging

lore
Share & tools
lore

Yash Mehla

author
#0 lore raw

PATCH v2 1/1 staging: rtl8723bs: replace msleep(10) with usleep_range()

msleep() should not be used for delays shorter than 20 ms. Replace msleep(10) with usleep_range(10000, 20000) and add <linux/delay.h> for the declaration.

---
 drivers/staging/rtl8723bs/core/rtw_cmd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/rtl8723bs/core/rtw_cmd.c +2 -1
index abb84f8ae..93a9e9672 100644
@@ -5,6 +5,7 @@
  *
  ******************************************************************************/
 #include <drv_types.h>
+#include <linux/delay.h>
 #include <hal_btcoex.h>
 #include <linux/jiffies.h>
 #include <linux/align.h>
@@ -214,7 +215,7 @@ void _rtw_free_evt_priv(struct	evt_priv *pevtpriv)
 {
 	_cancel_workitem_sync(&pevtpriv->c2h_wk);
 	while (pevtpriv->c2h_wk_alive)
-		msleep(10);
+		usleep_range(10000, 20000);
 
 	while (!rtw_cbuf_empty(pevtpriv->c2h_queue)) {
 		void *c2h = rtw_cbuf_pop(pevtpriv->c2h_queue);
Signature · 1 line
2.53.0