summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpiolib.c
diff options
context:
space:
mode:
authorUwe Kleine-König <ukleinek@informatik.uni-freiburg.de>2008-10-16 07:03:12 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-16 20:21:40 +0200
commit3d599d1ca57f443e5c4ff5af1e69d90350082f77 (patch)
tree475b066c18f2b610d6a0ee0a6313237ce61afc4a /drivers/gpio/gpiolib.c
parentgpio: max7301: fix the race between chip addition and pins reconfiguration (diff)
downloadlinux-3d599d1ca57f443e5c4ff5af1e69d90350082f77.tar.xz
linux-3d599d1ca57f443e5c4ff5af1e69d90350082f77.zip
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>
Diffstat (limited to 'drivers/gpio/gpiolib.c')
-rw-r--r--drivers/gpio/gpiolib.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 8d2940517c99..317004fd94fb 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -792,6 +792,8 @@ void gpio_free(unsigned gpio)
unsigned long flags;
struct gpio_desc *desc;
+ might_sleep();
+
if (!gpio_is_valid(gpio)) {
WARN_ON(extra_checks);
return;