gpio_free might sleep, generic part
According to the documentation gpio_free should only be called from task context only. To make this more explicit add a might sleep to all implementations. This is the generic part which changes gpiolib and the fallback implementation only. Signed-off-by: Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
c557fa3e4c
commit
3d599d1ca5
@@ -792,6 +792,8 @@ void gpio_free(unsigned gpio)
|
|||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
struct gpio_desc *desc;
|
struct gpio_desc *desc;
|
||||||
|
|
||||||
|
might_sleep();
|
||||||
|
|
||||||
if (!gpio_is_valid(gpio)) {
|
if (!gpio_is_valid(gpio)) {
|
||||||
WARN_ON(extra_checks);
|
WARN_ON(extra_checks);
|
||||||
return;
|
return;
|
||||||
|
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
#include <linux/kernel.h>
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
#include <linux/errno.h>
|
#include <linux/errno.h>
|
||||||
|
|
||||||
@@ -32,6 +33,8 @@ static inline int gpio_request(unsigned gpio, const char *label)
|
|||||||
|
|
||||||
static inline void gpio_free(unsigned gpio)
|
static inline void gpio_free(unsigned gpio)
|
||||||
{
|
{
|
||||||
|
might_sleep();
|
||||||
|
|
||||||
/* GPIO can never have been requested */
|
/* GPIO can never have been requested */
|
||||||
WARN_ON(1);
|
WARN_ON(1);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user