Hi,
since the pinctrl_register returns a pointer of structure type "struct
pinctrl_dev" or NULL if it was failed to register the pinctrl driver,
so IS_ERR checking is not required?
My understanding about IS_ERR is that its used when the pointer
addresses are kind of error codes rather actual addresses,
but are a kind of return codes of functions returning integer types.
Please correct me if my understanding is not correct.
Thanks,
Devendra.
On Mon, Jun 18, 2012 at 1:47 PM, devendra.aaru <[email protected]> wrote:
> since the pinctrl_register returns a pointer of structure type "struct
> pinctrl_dev" or NULL if it was failed to register the pinctrl driver,
> so IS_ERR checking is not required?
Yes. (Unless I did something wrong.)
> My understanding about IS_ERR is that its used when the pointer
> addresses are kind of error codes rather actual addresses,
> but are a kind of return codes of functions returning integer types.
You are absolutely right.
Yours,
Linus Walleij
Hi Linus,
On Mon, Jun 18, 2012 at 5:22 PM, Linus Walleij <[email protected]> wrote:
> On Mon, Jun 18, 2012 at 1:47 PM, devendra.aaru <[email protected]> wrote:
>
>> since the pinctrl_register returns a pointer of structure type "struct
>> pinctrl_dev" or NULL if it was failed to register the pinctrl driver,
>> so IS_ERR checking is not required?
>
> Yes. (Unless I did something wrong.)
>
So checking the return value of pinctrl_register with IS_ERR is not required.
There are drivers in pinctrl subsystem which uses the IS_ERR and may (not)
check whether its null or not.
you can expect a patchset of those fixes. :)
> Yours,
> Linus Walleij
Thanks,
Devendra.
On Mon, Jun 18, 2012 at 2:04 PM, devendra.aaru <[email protected]> wrote:
> So checking the return value of pinctrl_register with IS_ERR is not required.
Nope.
> There are drivers in pinctrl subsystem which uses the IS_ERR and may (not)
> check whether its null or not.
>
> you can expect a patchset of those fixes. :)
Good :-)
Thanks,
Linus Walleij
Hi Linus,
On Mon, Jun 18, 2012 at 8:08 PM, Linus Walleij <[email protected]> wrote:
> On Mon, Jun 18, 2012 at 2:04 PM, devendra.aaru <[email protected]> wrote:
>
>> So checking the return value of pinctrl_register with IS_ERR is not required.
>
> Nope.
You mean to say that the check "IS_ERR(ret_ptr)" is not required? or
the other way like
its also needed.
sorry for my poor understanding.
> Thanks,
> Linus Walleij
Thanks,
Devendra.
On Mon, Jun 18, 2012 at 4:42 PM, devendra.aaru <[email protected]> wrote:
> On Mon, Jun 18, 2012 at 8:08 PM, Linus Walleij <[email protected]> wrote:
>> On Mon, Jun 18, 2012 at 2:04 PM, devendra.aaru <[email protected]> wrote:
>>
>>> So checking the return value of pinctrl_register with IS_ERR is not required.
>>
>> Nope.
>
> You mean to say that the check "IS_ERR(ret_ptr)" is not required? or
> the other way like its also needed.
I mean it shall be tested like this:
if (!pinmctrl_register(&foo)) {
/* error case */
}
No IS_ERR() business.
Linus
Hi Linus,
On Wed, Jun 20, 2012 at 1:22 PM, Linus Walleij <[email protected]> wrote:
> I mean it shall be tested like this:
>
> if (!pinmctrl_register(&foo)) {
> ? ?/* error case */
> }
>
> No IS_ERR() business.
>
Yeah, and you already took the changes into your brach :-). Thanks!
> Linus
Devendra