[PATCH] Define a NO_GPIO macro to compare against and to use as an invalid GPIO

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Guennadi Liakhovetski
Date: Thursday, January 31, 2008 - 8:26 am

As discussed on i2c mailing list with David Brownell, and number
outside of the 0...MAX_INT range is invalid as a GPIO number.
Define a macro, similar to NO_IRQ, to be used as a deliberate
invalid GPIO, rather than defining a is_valid_gpio() macro.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@pengutronix.de>

---

As gpiolib doesn't seem to have an own mailing list, sending it directly 
to LKML.

 include/asm-generic/gpio.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index f29a502..806b86c 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -16,6 +16,10 @@
 #define ARCH_NR_GPIOS		256
 #endif
 
+#ifndef NO_GPIO
+#define NO_GPIO			((unsigned int)-1)
+#endif
+
 struct seq_file;
 
 /**
-- 
1.5.3.4
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Define a NO_GPIO macro to compare against and to u ..., Guennadi Liakhovetski, (Thu Jan 31, 8:26 am)
Re: [PATCH] Define a NO_GPIO macro to compare against and ..., Guennadi Liakhovetski, (Thu Feb 7, 8:24 am)
Re: [PATCH] Define a NO_GPIO macro to compare against and ..., Guennadi Liakhovetski, (Sat Feb 9, 5:13 pm)
Re: [PATCH] Define a NO_GPIO macro to compare against and ..., Guennadi Liakhovetski, (Sun Feb 10, 10:59 am)