From patchwork Fri Feb 22 04:39:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 2174481 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 32A893FD4E for ; Fri, 22 Feb 2013 04:39:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755841Ab3BVEjc (ORCPT ); Thu, 21 Feb 2013 23:39:32 -0500 Received: from mail-bk0-f50.google.com ([209.85.214.50]:53368 "EHLO mail-bk0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754625Ab3BVEjb (ORCPT ); Thu, 21 Feb 2013 23:39:31 -0500 Received: by mail-bk0-f50.google.com with SMTP id jg9so108502bkc.23 for ; Thu, 21 Feb 2013 20:39:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to:cc :content-type; bh=0o8rJO7dPYWiPGPkdqS1o6x18A6X4ByBV6Rm2LpCWzk=; b=z3d5WpQvo7XtKdH37An4jUAhEsHmHauBcIxYAy764O03B8QLAGMLBdm4u40emO0qsO hWL7iu2QM0SXas6FjMbNPDlTQ/NtstPEzWf16M7bL/4nuoqnmNNE7KYvVk5ZmYJ6+380 PiLc5PrRdYy6KPrEslXu8JgpOu2ED3tGAh4VLuXTkE3FrklHQXaViW128IACuQZaZk+c XbTwAbJKnlTXpym9CeC1jc8lEHDvhveZv/LXS/EygOExOf6y9i9OfgJ9PcVc0IfP2fh0 lkCbvxJdHny3QbKX5aK8rpZ7HmDtqKv55sntzA+eIPLoi9dAy2sh2PiDLYBDD1CIkJEc LAUw== MIME-Version: 1.0 X-Received: by 10.204.147.82 with SMTP id k18mr200213bkv.38.1361507970282; Thu, 21 Feb 2013 20:39:30 -0800 (PST) Received: by 10.204.30.210 with HTTP; Thu, 21 Feb 2013 20:39:30 -0800 (PST) Date: Fri, 22 Feb 2013 12:39:30 +0800 Message-ID: Subject: [PATCH -next] imx6q-cpufreq: fix return value check in imx6q_cpufreq_probe() From: Wei Yongjun To: rjw@sisk.pl, shawn.guo@linaro.org Cc: yongjun_wei@trendmicro.com.cn, cpufreq@vger.kernel.org, linux-pm@vger.kernel.org Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Wei Yongjun In case of error, the function devm_regulator_get() 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 Acked-by: Viresh Kumar Acked-by: Shawn Guo --- drivers/cpufreq/imx6q-cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c index d6b6ef3..54e336d 100644 --- a/drivers/cpufreq/imx6q-cpufreq.c +++ b/drivers/cpufreq/imx6q-cpufreq.c @@ -245,7 +245,7 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev) arm_reg = devm_regulator_get(cpu_dev, "arm"); pu_reg = devm_regulator_get(cpu_dev, "pu"); soc_reg = devm_regulator_get(cpu_dev, "soc"); - if (!arm_reg || !pu_reg || !soc_reg) { + if (IS_ERR(arm_reg) || IS_ERR(pu_reg) || IS_ERR(soc_reg)) { dev_err(cpu_dev, "failed to get regulators\n"); ret = -ENOENT; goto put_node;