Re: [RFC PATCH] Rework gpio cansleep (was Re: gpiolib and sleepinggpios)

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Lars-Peter Clausen
Date: Thursday, June 24, 2010 - 1:20 am

Jon Povey wrote:
Hi

Given that that most users will only access the gpios in context where
sleeping is possible it would make more sense to add a special case for
those who use it in contexts where sleeping is not possible.
This wouldn't change the semantics of the current API and furthermore it
is possible to implement it as a small helper function on top of the
current API.

Something like:
int gpio_request_atomic(unsigned gpio, const char *label)
{
    if (gpio_cansleep(gpio))
       return -EINVAL;
    return gpio_request(gpio, label);
}


- Lars
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [RFC PATCH] Rework gpio cansleep (was Re: gpiolib and ..., Lars-Peter Clausen, (Thu Jun 24, 1:20 am)
Re: [RFC PATCH] Rework gpio cansleep (was Re: gpiolib and ..., Lars-Peter Clausen, (Thu Jun 24, 3:31 am)