]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
mfd: arizona-core: msleep() is unreliable for anything <20ms use usleep_range() instead
authorLee Jones <lee.jones@linaro.org>
Wed, 28 Oct 2015 12:42:30 +0000 (12:42 +0000)
committerLee Jones <lee.jones@linaro.org>
Thu, 14 Jan 2016 08:43:58 +0000 (08:43 +0000)
WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+               msleep(1);

WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+                       msleep(5);

WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+               msleep(1);

WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+               msleep(1);

total: 0 errors, 4 warnings, 1407 lines checked

Cc: patches@opensource.wolfsonmicro.com
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/arizona-core.c

index 4bb486679110f4ae6f2f853c5faf3863eba74c04..5319f252790be97e84a4f0777904f70de6b93ac3 100644 (file)
@@ -238,7 +238,7 @@ static int arizona_poll_reg(struct arizona *arizona,
                if ((val & mask) == target)
                        return 0;
 
-               msleep(1);
+               usleep_range(1000, 5000);
        }
 
        dev_err(arizona->dev, "Polling reg %u timed out: %x\n", reg, val);
@@ -279,14 +279,14 @@ static void arizona_disable_reset(struct arizona *arizona)
                case WM5110:
                case WM8280:
                        /* Meet requirements for minimum reset duration */
-                       msleep(5);
+                       usleep_range(5000, 10000);
                        break;
                default:
                        break;
                }
 
                gpio_set_value_cansleep(arizona->pdata.reset, 1);
-               msleep(1);
+               usleep_range(1000, 5000);
        }
 }
 
@@ -1132,7 +1132,7 @@ int arizona_dev_init(struct arizona *arizona)
                        goto err_reset;
                }
 
-               msleep(1);
+               usleep_range(1000, 5000);
        }
 
        /* Ensure device startup is complete */