lkml.org 
[lkml]   [2012]   [Aug]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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).


\
 
 \ /
  Last update: 2012-08-07 19:21    [W:2.844 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site