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]

 



Hi Linus,

On Mon, May 2, 2016 at 11:06 AM, Linus Walleij <linus.walleij@xxxxxxxxxx> wrote:
> On Mon, May 2, 2016 at 11:04 AM, Geert Uytterhoeven
> <geert@xxxxxxxxxxxxxx> wrote:
>
>> [silly response deleted]
>>
>> Scrap it.
>
> :D
>
>> The only annoying thing is that 0 cannot easily be propagated upstream as
>> an error code, so it has to be tested for explicitly.
>
> Well with the Big Penguin's clear opinion on the matter there is not
> much we can do.
>
> What about this?
>
> diff --git a/drivers/tty/serial/serial_mctrl_gpio.c
> b/drivers/tty/serial/serial_mctrl_gpio.c
> index 02147361eaa9..2297ec781681 100644
> --- a/drivers/tty/serial/serial_mctrl_gpio.c
> +++ b/drivers/tty/serial/serial_mctrl_gpio.c
> @@ -172,6 +172,13 @@ struct mctrl_gpios *mctrl_gpio_init(struct
> uart_port *port, unsigned int idx)
>                         dev_err(port->dev,
>                                 "failed to find corresponding irq for
> %s (idx=%d, err=%d)\n",
>                                 mctrl_gpios_desc[i].name, idx, ret);
> +                       /*
> +                        * Satisfy the error code semantics for a missing IRQ,
> +                        * 0 means NO_IRQ, but the framework needs to return
> +                        * a negative to deal with the error.
> +                        */
> +                       if (!ret)
> +                               ret = -ENOSYS;

No, not -ENOSYS, as that triggers my initial problem again (please read the
deleted silly response ;-)
Checkpatch says: "ENOSYS means 'invalid syscall nr' and nothing else".

-EINVAL?

>                         return ERR_PTR(ret);
>                 }
>                 gpios->irq[i] = ret;

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds



[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