From patchwork Tue May 28 09:06:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 2623651 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id 8A4B53FDBC for ; Tue, 28 May 2013 09:06:52 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UhFrm-0001mm-NG; Tue, 28 May 2013 09:06:50 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UhFrk-0008Sw-0w; Tue, 28 May 2013 09:06:48 +0000 Received: from mail-bk0-x230.google.com ([2a00:1450:4008:c01::230]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UhFre-0008Rl-2M for linux-arm-kernel@lists.infradead.org; Tue, 28 May 2013 09:06:44 +0000 Received: by mail-bk0-f48.google.com with SMTP id jf20so2617174bkc.35 for ; Tue, 28 May 2013 02:06:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=T/jLomHbRlhst6+OuewYKREfhykuR2axJ4OYaE3iIvM=; b=KLdCHsnv4TM2u7+VU09iJJLgDzOzHQwaEk/mnGi1WAGOT0OnpqLKTxLa06+B82fO5v HWrqUPC2NUhm6SdW0skWQMAM6iMix1xV8gNuAaeZc5OtRdboEaAG3a85kmqubSpPpF/6 WtRHxiRwl7n6jkGhkjq0y4pRHU64ozITcXKpVj59pExGU3g+nMdYQmKpuKROjh76ZVzl 3gDmKstsM/s+hgIFWvc86ONe5OdZmb2lmOuloa8PMVjPmKCakT3qRS0czroh5XQtyIw6 s7pVdW6I+eZ4ays3m2NYp20HsyW+FTNq6QQeh/uNgbtQmjA5BXGg0Yvb1YzbZzI3zrKJ Fncw== MIME-Version: 1.0 X-Received: by 10.205.26.9 with SMTP id rk9mr2997036bkb.39.1369731976186; Tue, 28 May 2013 02:06:16 -0700 (PDT) Received: by 10.204.39.1 with HTTP; Tue, 28 May 2013 02:06:15 -0700 (PDT) Date: Tue, 28 May 2013 17:06:15 +0800 Message-ID: Subject: [PATCH -next] dmaengine: ste_dma40: fix error return code in d40_probe() From: Wei Yongjun To: srinidhi.kasagar@stericsson.com, linus.walleij@linaro.org, djbw@fb.com, vinod.koul@intel.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130528_050642_249421_F22F0C7B X-CRM114-Status: GOOD ( 11.84 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (weiyj.lk[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: yongjun_wei@trendmicro.com.cn, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Wei Yongjun 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'. Signed-off-by: Wei Yongjun --- drivers/dma/ste_dma40.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index 71bf4ec..cbf9c62 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -3474,7 +3474,6 @@ failure: static int __init d40_probe(struct platform_device *pdev) { - int err; int ret = -ENOENT; struct d40_base *base; struct resource *res = NULL; @@ -3576,6 +3575,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); goto failure; } @@ -3590,13 +3590,13 @@ static int __init d40_probe(struct platform_device *pdev) } base->initialized = true; - err = d40_dmaengine_init(base, num_reserved_chans); - if (err) + ret = d40_dmaengine_init(base, num_reserved_chans); + if (ret) goto failure; base->dev->dma_parms = &base->dma_parms; - err = dma_set_max_seg_size(base->dev, STEDMA40_MAX_SEG_SIZE); - if (err) { + ret = dma_set_max_seg_size(base->dev, STEDMA40_MAX_SEG_SIZE); + if (ret) { d40_err(&pdev->dev, "Failed to set dma max seg size\n"); goto failure; }