[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNAQ3GbG0BCiESOnO1=qViXOer0StEEbjxUYumbGa73VgZw@mail.gmail.com>
Date: Tue, 26 May 2015 17:20:24 +0900
From: Masahiro Yamada <yamada.masahiro@...ionext.com>
To: Arnd Bergmann <arnd@...db.de>
Cc: linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
linux-gpio@...r.kernel.org,
Linus Walleij <linus.walleij@...aro.org>,
Michal Simek <michal.simek@...inx.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Sören Brinkmann <soren.brinkmann@...inx.com>
Subject: Re: [PATCH] pinctrl: zynq: change error code for pinctrl_register failure
Hi Arnd,
2015-05-26 17:12 GMT+09:00 Arnd Bergmann <arnd@...db.de>:
> On Tuesday 26 May 2015 13:18:29 Masahiro Yamada wrote:
>> diff --git a/drivers/pinctrl/pinctrl-zynq.c b/drivers/pinctrl/pinctrl-zynq.c
>> index 04748a4..0ff653c 100644
>> --- a/drivers/pinctrl/pinctrl-zynq.c
>> +++ b/drivers/pinctrl/pinctrl-zynq.c
>> @@ -1141,7 +1141,7 @@ static int zynq_pinctrl_probe(struct platform_device *pdev)
>>
>> pctrl->pctrl = pinctrl_register(&zynq_desc, &pdev->dev, pctrl);
>> if (!pctrl->pctrl)
>> - return -ENOMEM;
>> + return -EINVAL;
>>
>> platform_set_drvdata(pdev, pctrl);
>>
>>
>
> One choice seems as bad as the other to me ;-)
>
> Could we add a pinctrl_register_reason() variant that returns a meaningful
> error code as ERR_PTR?
I also thought of it.
I was wondering why pinctrl_register() did not return ERR_PTR.
Can we migrate to ERR_PTR in the long run?
[1] Add pinctrl_register_reason()
[2] Replace pinctrl_register() in each driver with
pinctrl_register_reason() one by one
[3] Eventually, pinctrl_register will disappear
[4] Rename pinctrl_register_reason() into pinctrl_register()
--
Best Regards
Masahiro Yamada
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists