Messages in this thread | | | Date | Tue, 7 Aug 2012 17:28:22 +0100 | From | Mark Brown <> | Subject | Re: [PATCH 1/3] backlight: da9052: Use usleep_range() instead of msleep() for small sleeps |
| |
On Mon, Aug 06, 2012 at 01:59:38PM +0900, Jingoo Han wrote: > On Monday, August 06, 2012 1:48 PM Sachin Kamat wrote:
> > > + usleep_range(10000, 11000);
> > Can't we just use usleep(10000) instead?
> usleep() is not available. > For more details, refer to Documentation/timers/timers-howto.txt.
Given how common this pattern is is it not more sensible to just provide usleep() even if just as an inline that's something like
void usleep(unsigned long t) { usleep_range(t, t + (t / 10)); }
since the usleep_range() isn't ideal for clarity (and usually the upper bound isn't a particular concern for the driver, it just wants the usual "delay for at least x" semantics).
| |