diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2013-02-21 23:39:30 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-02-22 18:30:25 -0500 |
commit | 3a3656d4011625cf98f8cc351968fe30af3cc9ac (patch) | |
tree | 7bd84c6a566f148ca81709a81c32c33b0a3f091c /drivers/cpufreq/imx6q-cpufreq.c | |
parent | d6561bb206aae9de8eee4516549339ee96386b87 (diff) |
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 <yongjun_wei@trendmicro.com.cn>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/imx6q-cpufreq.c')
-rw-r--r-- | drivers/cpufreq/imx6q-cpufreq.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c index d6b6ef350cb6..54e336de373b 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) | |||
245 | arm_reg = devm_regulator_get(cpu_dev, "arm"); | 245 | arm_reg = devm_regulator_get(cpu_dev, "arm"); |
246 | pu_reg = devm_regulator_get(cpu_dev, "pu"); | 246 | pu_reg = devm_regulator_get(cpu_dev, "pu"); |
247 | soc_reg = devm_regulator_get(cpu_dev, "soc"); | 247 | soc_reg = devm_regulator_get(cpu_dev, "soc"); |
248 | if (!arm_reg || !pu_reg || !soc_reg) { | 248 | if (IS_ERR(arm_reg) || IS_ERR(pu_reg) || IS_ERR(soc_reg)) { |
249 | dev_err(cpu_dev, "failed to get regulators\n"); | 249 | dev_err(cpu_dev, "failed to get regulators\n"); |
250 | ret = -ENOENT; | 250 | ret = -ENOENT; |
251 | goto put_node; | 251 | goto put_node; |