x86, debug: gpio_free might sleep
authorUwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
Mon, 15 Sep 2008 20:02:43 +0000 (22:02 +0200)
committerIngo Molnar <mingo@elte.hu>
Wed, 17 Sep 2008 12:58:46 +0000 (14:58 +0200)
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 patch changes the gpio_free implementations for the x86
architecture.

Signed-off-by: Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
include/asm-x86/mach-rdc321x/gpio.h

index acce0b7..3639ece 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef _RDC321X_GPIO_H
 #define _RDC321X_GPIO_H
 
+#include <linux/kernel.h>
+
 extern int rdc_gpio_get_value(unsigned gpio);
 extern void rdc_gpio_set_value(unsigned gpio, int value);
 extern int rdc_gpio_direction_input(unsigned gpio);
@@ -18,6 +20,7 @@ static inline int gpio_request(unsigned gpio, const char *label)
 
 static inline void gpio_free(unsigned gpio)
 {
+       might_sleep();
        rdc_gpio_free(gpio);
 }