[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPgLHd-Gj0UXLdMYdQyGtyHY8T_c=XENc-=SZ=nejCKMiAFXkQ@mail.gmail.com>
Date: Fri, 31 May 2013 09:07:36 +0800
From: Wei Yongjun <weiyj.lk@...il.com>
To: andy.shevchenko@...il.com
Cc: srinidhi.kasagar@...ricsson.com, linus.walleij@...aro.org,
vinod.koul@...el.com, djbw@...com, grant.likely@...aro.org,
rob.herring@...xeda.com, yongjun_wei@...ndmicro.com.cn,
linux-arm-kernel@...ts.infradead.org,
devicetree-discuss@...ts.ozlabs.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH -next v2] dmaengine: ste_dma40: fix error return code in d40_probe()
On 05/31/2013 02:29 AM, Andy Shevchenko wrote:
> On Thu, May 30, 2013 at 7:32 AM, Wei Yongjun <weiyj.lk@...il.com> wrote:
>> In many of the error handling case, the return value 'ret' not set
>> and 0 will be return from d40_probe() even if error, but we should
>> return a negative error code instead in those error handling case.
>> This patch fixed them, and also removed useless variable 'err'.
> Hold on, please.
>
>> --- a/drivers/dma/ste_dma40.c
>> +++ b/drivers/dma/ste_dma40.c
>> @@ -3619,6 +3618,7 @@ static int __init d40_probe(struct platform_device *pdev)
>> if (IS_ERR(base->lcpa_regulator)) {
>> d40_err(&pdev->dev, "Failed to get lcpa_regulator\n");
>> base->lcpa_regulator = NULL;
>> + ret = PTR_ERR(base->lcpa_regulator);
> Is it really what we want?
>
> I thixh you may remove that NULL assignment.
Ohh, I will move the ret = PTR_ERR(base->lcpa_regulator) above the NULL
assignment, the failure path test for base->lcpa_regulator to release regulator.
if (base->lcpa_regulator) {
regulator_disable(base->lcpa_regulator);
regulator_put(base->lcpa_regulator);
}
>
>
>> goto failure;
>> }
>>
>> @@ -3647,8 +3647,8 @@ static int __init d40_probe(struct platform_device *pdev)
>> d40_hw_init(base);
>>
>> if (np) {
>> - err = of_dma_controller_register(np, d40_xlate, NULL);
>> - if (err && err != -ENODEV)
>> + ret = of_dma_controller_register(np, d40_xlate, NULL);
>> + if (ret && ret != -ENODEV)
> >From the discussion of dw_dmac I remember we decide that ENODEV check
> is redundant.
Get it, I will remove the ENODEV check.
Thanks,
Yongjun Wei
--
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