[PATCH 07/21] OMAP3+: PM: SR/Class3: disable errorgen before disable VP

Jean Pihet jean.pihet at newoldbits.com
Tue Jan 31 08:39:48 EST 2012


Sergei,

On Tue, Jan 31, 2012 at 12:37 PM, Sergei Shtylyov
<sshtylyov at ru.mvista.com> wrote:
> Hello.
>
>
> On 31-01-2012 14:06, Jean Pihet wrote:
>
>> ...
>
>
>>>> +int sr_disable_errgen(struct voltagedomain *voltdm)
>>>> +{
>>>> +       u32 errconfig_offs, vpboundint_en;
>>>> +       u32 vpboundint_st;
>>>> +       struct omap_sr *sr = _sr_lookup(voltdm);
>>>> +
>>>> +       if (IS_ERR(sr)) {
>>>> +               pr_warning("%s: omap_sr struct for sr_%s not found\n",
>>>> +                       __func__, voltdm->name);
>>>> +               return -EINVAL;
>>>
>>>
>>>
>>>   Not PTR_ERR(sr)?
>
>
>> _sr_lookup returns a return code using ERR_PTR so the return value
>> should be checked for errors using IS_ERR. Please note that _sr_lookup
>> checks for NULL parameter internally.
>
>
>   That's clear. I was asking don't you want to return PTR_ERR(sr) instead of
> -EINVAL.
Oh yes you are correct, that is a good catch. Sorry for my misunderstanding.

I caught the same problem at a few other places and I have a patch
ready for the error handling code. To be submitted asap.

>
> WBR, Sergei

Thanks!
Jean



More information about the linux-arm-kernel mailing list