Skip to contentSkip to conversation

staging: rtl8712: usleep_range is preferred over udelay

PATCH Superseded Amitoj Kaur Chawla 2 participants 2 messages Oct 9, 2015 – Oct 10, 2015 Staging

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 staging: rtl8712: usleep_range is preferred over udelay

Fix checkpatch.pl issue: "CHECK: usleep_range is preferred over udelay;
see Documentation/timers/timers-howto.txt".
Replace udelay() with a call to usleep_range() with a reasonable upper limit determined by the other sleeping functions present.

---
Changes in v2:
-Modified commit message
-Replaced the second udelay() with usleep_range() present in the
same function

 drivers/staging/rtl8712/hal_init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8712/hal_init.c +2 -2
index 15c6160..2031291 100644
@@ -209,7 +209,7 @@ static u8 rtl8712_dl_fw(struct _adapter *padapter)
 		i = 10;
 		tmp16 = r8712_read16(padapter, TCR);
 		while (((tmp16 & _IMEM_CODE_DONE) == 0) && (i > 0)) {
-			udelay(10);
+			usleep_range(10,1000);
 			tmp16 = r8712_read16(padapter, TCR);
 			i--;
 		}
@@ -237,7 +237,7 @@ static u8 rtl8712_dl_fw(struct _adapter *padapter)
 		i = 5;
 		tmp16 = r8712_read16(padapter, TCR);
 		while (((tmp16 & _EMEM_CODE_DONE) == 0) && (i > 0)) {
-			udelay(10);
+			usleep_range(10,1000);
 			tmp16 = r8712_read16(padapter, TCR);
 			i--;
 		}
Signature · 1 line
1.9.1
#1 lore raw
Quoted 21 lines · Amitoj Kaur Chawla

Fix checkpatch.pl issue: "CHECK: usleep_range is preferred over udelay;
see Documentation/timers/timers-howto.txt".
Replace udelay() with a call to usleep_range() with a reasonable upper limit determined by the other sleeping functions present.

---
Changes in v2:
-Modified commit message
-Replaced the second udelay() with usleep_range() present in the
same function

 drivers/staging/rtl8712/hal_init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8712/hal_init.c +0 -0
index 15c6160..2031291 100644

drivers/staging/rtl8712/hal_init.c static u8 rtl8712_dl_fw(struct _adapter *padapter) · line 212

Quoted 5 lines
drivers/staging/rtl8712/hal_init.c +1 -1
@@ -209,7 +209,7 @@ static u8 rtl8712_dl_fw(struct _adapter *padapter)
 		i = 10;
 		tmp16 = r8712_read16(padapter, TCR);
 		while (((tmp16 & _IMEM_CODE_DONE) == 0) && (i > 0)) {
-			udelay(10);
+			usleep_range(10,1000);

checkpatch should complain here about a space after ','

regards
sudip