From: Wei Yongjun Date: Fri, 22 Feb 2013 04:39:30 +0000 (+0000) Subject: imx6q-cpufreq: fix return value check in imx6q_cpufreq_probe() X-Git-Tag: upstream/snapshot3+hdmi~5650^2~2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3a3656d4011625cf98f8cc351968fe30af3cc9ac;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git imx6q-cpufreq: fix return value check in imx6q_cpufreq_probe() 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 Signed-off-by: Rafael J. Wysocki --- 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;