Staging: olpc_dcon: change to msleep to usleep_range
authorJens Frederich <jfrederich@gmail.com>
Thu, 25 Jul 2013 20:06:32 +0000 (22:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jul 2013 20:38:09 +0000 (13:38 -0700)
The resolution of msleep is related to HZ, so with HZ set to
100 any msleep of less then 10ms will become ~10ms. This is
not what we want. Use usleep_range to get more control of
what is happening here.

Signed-off-by: Jens Frederich <jfrederich@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/olpc_dcon/olpc_dcon.c

index 193e1c68bb4543a35fcde546c0423d3b99e7df26..7c460f2c0d230565be67045b5f3b11b423295257 100644 (file)
@@ -131,13 +131,13 @@ power_up:
                        pr_warn("unable to force dcon to power up: %d!\n", x);
                        return x;
                }
-               msleep(10); /* we'll be conservative */
+               usleep_range(10000, 11000);  /* we'll be conservative */
        }
 
        pdata->bus_stabilize_wiggle();
 
        for (x = -1, timeout = 50; timeout && x < 0; timeout--) {
-               msleep(1);
+               usleep_range(1000, 1100);
                x = dcon_read(dcon, DCON_REG_ID);
        }
        if (x < 0) {