summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorThomas Kunze <thommycheck@gmx.de>2009-02-09 23:14:44 +0100
committerThomas Kunze <tkunze@tkunze-desktop.(none)>2009-11-27 21:07:20 +0100
commitcc647172795713e013f8de4bcdf91860e9e87bff (patch)
treea3a9538fcc03253bfc81063c08e5a35653b960d9 /arch
parent167c55ef80d26679b8b4b4ffba9da208a7c1875d (diff)
downloadop-kernel-dev-cc647172795713e013f8de4bcdf91860e9e87bff.zip
op-kernel-dev-cc647172795713e013f8de4bcdf91860e9e87bff.tar.gz
SA1100: make gpio_to_irq and reverse a macro
The function can't be used for static initialisations so convert them to macros.
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-sa1100/include/mach/gpio.h19
1 files changed, 4 insertions, 15 deletions
diff --git a/arch/arm/mach-sa1100/include/mach/gpio.h b/arch/arm/mach-sa1100/include/mach/gpio.h
index 582a0c9..7befc10 100644
--- a/arch/arm/mach-sa1100/include/mach/gpio.h
+++ b/arch/arm/mach-sa1100/include/mach/gpio.h
@@ -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
OpenPOWER on IntegriCloud