]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
SA1100: make gpio_to_irq and reverse a macro
authorThomas Kunze <thommycheck@gmx.de>
Mon, 9 Feb 2009 22:14:44 +0000 (23:14 +0100)
committerThomas Kunze <tkunze@tkunze-desktop.(none)>
Fri, 27 Nov 2009 20:07:20 +0000 (21:07 +0100)
The function can't be used for static initialisations so
convert them to macros.

arch/arm/mach-sa1100/include/mach/gpio.h

index 582a0c92da53c74d73f6fce5b09c7dee1b08ddd8..7befc104e9a97a2fef34fae884b32a8cb2d54d38 100644 (file)
@@ -49,20 +49,9 @@ static inline void gpio_set_value(unsigned gpio, int value)
 
 #define gpio_cansleep  __gpio_cansleep
 
-static inline unsigned gpio_to_irq(unsigned gpio)
-{
-       if (gpio < 11)
-               return IRQ_GPIO0 + gpio;
-       else
-               return IRQ_GPIO11 - 11 + gpio;
-}
-
-static inline unsigned irq_to_gpio(unsigned irq)
-{
-       if (irq < IRQ_GPIO11_27)
-               return irq - IRQ_GPIO0;
-       else
-               return irq - IRQ_GPIO11 + 11;
-}
+#define gpio_to_irq(gpio)      ((gpio < 11) ? (IRQ_GPIO0 + gpio) : \
+                                       (IRQ_GPIO11 - 11 + gpio))
+#define irq_to_gpio(irq)       ((irq < IRQ_GPIO11_27) ? (irq - IRQ_GPIO0) : \
+                                       (irq - IRQ_GPIO11 + 11))
 
 #endif