提交 cc1ad4a6 编写于 作者: H Hartley Sweeten 提交者: Russell King

ARM: 5745/1: Change ep93xx gpio_irq static inlines to macros

From: Ryan Mallon <ryan@bluewatersys.com>

Change the gpio_to_irq and irq_to_gpio static inline functions to
macros so that they can be used in variable initialisers.
Signed-off-by: NRyan Mallon <ryan@bluewatersys.com>
Acked-by: NH Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
上级 1f8db4fc
...@@ -114,17 +114,9 @@ extern void ep93xx_gpio_int_debounce(unsigned int irq, int enable); ...@@ -114,17 +114,9 @@ extern void ep93xx_gpio_int_debounce(unsigned int irq, int enable);
* B0..B7 (7..15) to irq 72..79, and * B0..B7 (7..15) to irq 72..79, and
* F0..F7 (16..24) to irq 80..87. * F0..F7 (16..24) to irq 80..87.
*/ */
static inline int gpio_to_irq(unsigned gpio) #define gpio_to_irq(gpio) \
{ (((gpio) <= EP93XX_GPIO_LINE_MAX_IRQ) ? (64 + (gpio)) : -EINVAL)
if (gpio <= EP93XX_GPIO_LINE_MAX_IRQ)
return 64 + gpio; #define irq_to_gpio(irq) ((irq) - gpio_to_irq(0))
return -EINVAL;
}
static inline int irq_to_gpio(unsigned irq)
{
return irq - gpio_to_irq(0);
}
#endif #endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册