PM / OPP: passing NULL to PTR_ERR()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 21 Sep 2015 16:26:02 +0000 (19:26 +0300)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 9 Oct 2015 20:17:34 +0000 (22:17 +0200)
The code was using PTR_ERR(NULL) which causes a static checker warning.
I have fixed up the printks and changed the return to -ENOENT.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/power/opp/cpu.c

index 3d946b508a13870618b4ad65af098fab87296b31..7654c5606307f7e3d71903385964e3af9a71caea 100644 (file)
@@ -223,8 +223,7 @@ int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, cpumask_var_t cpumask
        /* Get OPP descriptor node */
        np = _of_get_opp_desc_node(cpu_dev);
        if (!np) {
-               dev_dbg(cpu_dev, "%s: Couldn't find opp node: %ld\n", __func__,
-                       PTR_ERR(np));
+               dev_dbg(cpu_dev, "%s: Couldn't find cpu_dev node.\n", __func__);
                return -ENOENT;
        }
 
@@ -247,9 +246,9 @@ int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, cpumask_var_t cpumask
                /* Get OPP descriptor node */
                tmp_np = _of_get_opp_desc_node(tcpu_dev);
                if (!tmp_np) {
-                       dev_err(tcpu_dev, "%s: Couldn't find opp node: %ld\n",
-                               __func__, PTR_ERR(tmp_np));
-                       ret = PTR_ERR(tmp_np);
+                       dev_err(tcpu_dev, "%s: Couldn't find tcpu_dev node.\n",
+                               __func__);
+                       ret = -ENOENT;
                        goto put_cpu_node;
                }