lkml.org 
[lkml]   [2015]   [Jun]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] pinctrl: add pinctrl_register_reason() to return proper error code
From
Hi Linus,


2015-06-02 21:56 GMT+09:00 Linus Walleij <linus.walleij@linaro.org>:
> On Fri, May 29, 2015 at 1:30 PM, Masahiro Yamada
> <yamada.masahiro@socionext.com> wrote:
>
>> The pinctrl_register() just returns NULL on error, so the callers
>> can not know the exact reason of the failure.
>>
>> Some of the pinctrl drivers return -EINVAL, some -ENODEV, and some
>> -ENOMEM on error of pinctrl_register() , although the error code
>> might be different from the actual cause of the error.
>>
>> This new function, pinctrl_register_reason(), helps the drivers get
>> and return the appropriate error code.
>>
>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>> Suggested-by: Arnd Bergmann <arnd@arndb.de>
>
> It should be named pinctrl_register_strict() or something.
> "reason" is anyways wrong, should be "cause", but please
> use _strict().

OK, I will do it.


>> If this patch is accepted, I can send a series to replace
>> the pinctrl_register() in each driver with pinctrl_register_reason().
>
> If it is replaced *everywhere* there is no point in keeping
> a separate function. Then you should just do a big
> patch changing all usage sites and the original function.


If nobody is opposed to this, I can send a single big patch
replacing all the references.

In that case, we would not need _strict().

My concern is the sudden change of the function interface
will break drivers that are under development out of the source tree.



--
Best Regards
Masahiro Yamada


\
 
 \ /
  Last update: 2015-06-02 18:01    [W:2.275 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site