public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Define a NO_GPIO macro to compare against and to use as an invalid GPIO
@ 2008-01-31 15:26 Guennadi Liakhovetski
  2008-02-07 15:24 ` Guennadi Liakhovetski
  2008-02-08 23:43 ` David Brownell
  0 siblings, 2 replies; 6+ messages in thread
From: Guennadi Liakhovetski @ 2008-01-31 15:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: David Brownell, i2c

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-02-10 17:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-31 15:26 [PATCH] Define a NO_GPIO macro to compare against and to use as an invalid GPIO Guennadi Liakhovetski
2008-02-07 15:24 ` Guennadi Liakhovetski
2008-02-08 23:43 ` David Brownell
2008-02-10  0:13   ` Guennadi Liakhovetski
     [not found]     ` <Pine.LNX.4.64.0802100053450.7517-0199iw4Nj15frtckUFj5Ag@public.gmane.org>
2008-02-10  1:27       ` David Brownell
2008-02-10 17:59         ` Guennadi Liakhovetski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox