]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: rtl8712: usleep_range is preferred over udelay
authorAmitoj Kaur Chawla <amitoj1606@gmail.com>
Sat, 10 Oct 2015 12:24:09 +0000 (17:54 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Oct 2015 03:43:20 +0000 (20:43 -0700)
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.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8712/hal_init.c

index d3a12083e86d34a52a951141558c3fe3ac75319c..e0ae57d32fa17a8a6fc6d063cb0406052067b65e 100644 (file)
@@ -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--;
                }