Re: [PATCH] pinctrl: sh-pfc: Let gpio_chip.to_irq() return -ENXIO on error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 2, 2016 at 10:03 AM, Geert Uytterhoeven
<geert@xxxxxxxxxxxxxx> wrote:
> On Sun, May 1, 2016 at 10:48 AM, Linus Walleij <linus.walleij@xxxxxxxxxx> wrote:

>>>   - Drivers that call irq_find_mapping(), irq_create_mapping(), or
>>>     irq_create_fwspec_mapping() return zero!  This also applies to the
>>>     core helper gpiochip_to_irq().
>>
>> Zero means NO_IRQ.
>>
>> Reminder:
>> http://lwn.net/Articles/470820/
>>
>> What we should do is patch all drivers to return 0 on failure, and
>> patch any consumers like mctrl_gpio_init() to handle that correctly.
>
> That's the Long Term Plan. There are still too many non-zero NO_IRQ
> definitions in use...
>
> Is -ENXIO acceptable for the short term?

I don't understand. You say you have a problem  with
mctrl_gpio_init() which looks like this:

        ret = gpiod_to_irq(gpios->gpio[i]);
        if (ret <= 0) {
            dev_err(port->dev, (...)

This function is already *correctly* handling zero as NO_IRQ
i.e. an error.

Just make your driver return 0/NO_IRQ and it is fixed.

Or are there other problems that you're not telling about?

Yours,
Linus Walleij



[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux