[PATCH] gpio_free might sleep, x86 architecture

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Uwe Kleine-König
Date: Monday, September 15, 2008 - 1:02 pm

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>
Cc: David Brownell <david-b@pacbell.net>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Guennadi Liakhovetski <g.liakhovetski@pengutronix.de>
Cc: Greg KH <greg@kroah.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
---
 include/asm-x86/mach-rdc321x/gpio.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/asm-x86/mach-rdc321x/gpio.h b/include/asm-x86/mach-rdc321x/gpio.h
index acce0b7..3639ece 100644
--- a/include/asm-x86/mach-rdc321x/gpio.h
+++ b/include/asm-x86/mach-rdc321x/gpio.h
@@ -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);
 }
 
-- 
1.5.6.5

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

Messages in current thread:
[PATCH] add might_sleep() to all implementations of gpio_free, Uwe Kleine-König, (Thu Jul 24, 12:28 am)
[PATCH] gpio_free might sleep, generic part, Uwe Kleine-König, (Mon Sep 15, 1:02 pm)
[PATCH] gpio_free might sleep, arm architecture, Uwe Kleine-König, (Mon Sep 15, 1:02 pm)
[PATCH] gpio_free might sleep, mips architecture, Uwe Kleine-König, (Mon Sep 15, 1:02 pm)
[PATCH] gpio_free might sleep, blackfin architecture, Uwe Kleine-König, (Mon Sep 15, 1:02 pm)
[PATCH] gpio_free might sleep, x86 architecture, Uwe Kleine-König, (Mon Sep 15, 1:02 pm)
Re: [PATCH] gpio_free might sleep, arm architecture, David Brownell, (Mon Sep 15, 2:21 pm)
Re: [PATCH] gpio_free might sleep, x86 architecture, Ingo Molnar, (Wed Sep 17, 5:59 am)
Re: [PATCH] gpio_free might sleep, mips architecture, Andrew Morton, (Wed Sep 17, 2:39 pm)
Re: [PATCH] gpio_free might sleep, mips architecture, Ralf Baechle, (Thu Sep 18, 6:59 am)