On Mon, May 2, 2016 at 12:05 PM, Geert Uytterhoeven
<ge...@linux-m68k.org> wrote:

> gpiod_to_irq() is documented to return a negative error code on failure,
> cfr. Documentation/gpio/consumer.txt and drivers/gpio/gpiolib.c.
> In fact the check in mctrl_gpio_init() is the only caller that
> considers zero as an
> error.
>
> Perhaps gpiod_to_irq() should handle .to_irq() returning zero instead?

OK good point, I sent a patch like so, let's see what people say.

I'm a bit torn: part of me feel that since the function has *_to_irq()
in it it should use zero for NO_IRQ if there is no translation.

But this works too, whatever, rough consensus and running code.

Yours,
Linus Walleij

Reply via email to