gpiolib, irqs and error returns

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jon Smirl
Date: Sunday, August 31, 2008 - 9:17 pm

From Documentation/gpio.txt

        /* map GPIO numbers to IRQ numbers */
        int gpio_to_irq(unsigned gpio);

        /* map IRQ numbers to GPIO numbers */
        int irq_to_gpio(unsigned irq);

Those return either the corresponding number in the other namespace, or
else a negative errno code if the mapping can't be done.  (For example,
some GPIOs can't be used as IRQs.)  It is an unchecked error to use a GPIO
number that wasn't set up as an input using gpio_direction_input(), or
to use an IRQ number that didn't originally come from gpio_to_irq().

------------------------------------------------------------

Isn't an irq now an unsigned int? And the only possible error return
is NO_IRQ (ie 0).

-- 
Jon Smirl
jonsmirl@gmail.com
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
gpiolib, irqs and error returns, Jon Smirl, (Sun Aug 31, 9:17 pm)