From patchwork Thu Jul 4 13:51:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 2823821 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 53E89BF4A1 for ; Thu, 4 Jul 2013 13:52:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 261062018B for ; Thu, 4 Jul 2013 13:52:04 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CFB4920152 for ; Thu, 4 Jul 2013 13:52:02 +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 1Uujx0-0006Z5-KB; Thu, 04 Jul 2013 13:51:58 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uujwy-0000RT-4J; Thu, 04 Jul 2013 13:51:56 +0000 Received: from mail-bk0-x232.google.com ([2a00:1450:4008:c01::232]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uujwv-0000Qm-CT for linux-arm-kernel@lists.infradead.org; Thu, 04 Jul 2013 13:51:54 +0000 Received: by mail-bk0-f50.google.com with SMTP id ik8so651566bkc.23 for ; Thu, 04 Jul 2013 06:51:31 -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=WkjP/f3QYQzt3wUR3Cbqf+jLAKkDM2KnFgmOKry3N/M=; b=I8Pf4A1vJ3kPSzLhJLssDuZZF+HmPKVVReF7PCPGMECnzLRsgbFqiQEAFq9GPdzDvw 8ksX1JRxDa834q64mY2H01I/Kryd7XCiIamY97NeWEeHalWJYbaz4AgOMniL57yXCwg/ qKzuB/pz5DhaIPhDRZZPFGnVZOflkNcSpDMxHWtpA26aBfafI73sT/TDR5FCgRva1ApD MA6o//IxsR9hyovwi5ZXktKmfj7HAdOWsSVqQWHuwuYCjFYYF5fGBuc5Hd4XUqpExfRv l2bkwu99UxdL13U42+tnOgP2ePqsYECfdQa9Gx+BencTODq7lfm0PYobTFEAhDxXAqxG h61Q== MIME-Version: 1.0 X-Received: by 10.204.224.77 with SMTP id in13mr1127723bkb.24.1372945891352; Thu, 04 Jul 2013 06:51:31 -0700 (PDT) Received: by 10.205.122.72 with HTTP; Thu, 4 Jul 2013 06:51:31 -0700 (PDT) Date: Thu, 4 Jul 2013 21:51:31 +0800 Message-ID: Subject: [PATCH] ARM: u300: fix return value check in __u300_init_boardpower() From: Wei Yongjun To: linus.walleij@linaro.org, linux@arm.linux.org.uk, grant.likely@linaro.org, rob.herring@calxeda.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130704_095153_582028_1A74B3E3 X-CRM114-Status: GOOD ( 12.18 ) X-Spam-Score: -2.0 (--) Cc: yongjun_wei@trendmicro.com.cn, devicetree-discuss@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.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 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun In case of error, the function syscon_node_to_regmap() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Wei Yongjun --- arch/arm/mach-u300/regulator.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-u300/regulator.c b/arch/arm/mach-u300/regulator.c index bf40cd4..0493a84 100644 --- a/arch/arm/mach-u300/regulator.c +++ b/arch/arm/mach-u300/regulator.c @@ -69,9 +69,9 @@ static int __init __u300_init_boardpower(struct platform_device *pdev) return -ENODEV; } regmap = syscon_node_to_regmap(syscon_np); - if (!regmap) { + if (IS_ERR(regmap)) { pr_crit("U300: could not locate syscon regmap\n"); - return -ENODEV; + return PTR_ERR(regmap); } main_power_15 = regulator_get(&pdev->dev, "vana15");