Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753082Ab3E3S30 (ORCPT ); Thu, 30 May 2013 14:29:26 -0400 Received: from mail-la0-f53.google.com ([209.85.215.53]:57516 "EHLO mail-la0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751930Ab3E3S3S (ORCPT ); Thu, 30 May 2013 14:29:18 -0400 MIME-Version: 1.0 In-Reply-To: References: Date: Thu, 30 May 2013 21:29:16 +0300 Message-ID: Subject: Re: [PATCH -next v2] dmaengine: ste_dma40: fix error return code in d40_probe() From: Andy Shevchenko To: Wei Yongjun Cc: srinidhi.kasagar@stericsson.com, Linus Walleij , Vinod Koul , Dan Williams , Grant Likely , Rob Herring , yongjun_wei@trendmicro.com.cn, linux-arm Mailing List , Devicetree Discuss , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1643 Lines: 46 On Thu, May 30, 2013 at 7:32 AM, Wei Yongjun 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. > 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. -- With Best Regards, Andy Shevchenko -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/