Re: [PATCH 1/3] backlight: da9052: Use usleep_range() instead ofmsleep() for small sleeps

From: Mark Brown
Date: Tue Aug 07 2012 - 12:28:39 EST


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).
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/