PM / Domain: Return 0 on error from of_genpd_opp_to_performance_state()
authorViresh Kumar <viresh.kumar@linaro.org>
Thu, 24 May 2018 10:32:40 +0000 (16:02 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 24 May 2018 17:08:14 +0000 (19:08 +0200)
of_genpd_opp_to_performance_state() should return 0 on errors, as its
doc comment describes. While it follows that mostly, it returns a
negative error number on one of the failures.

Fix that.

Fixes: 6e41766a6a50 "PM / Domain: Implement of_genpd_opp_to_performance_state()"
Reported-by: Rajendra Nayak <rnayak@codeaurora.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/power/domain.c

index da6c8860c72e7249ae376464d690507352d987f9..71a1cc79fbaa78fd86bb98a5a69a61ea38ea9b9a 100644 (file)
@@ -2431,7 +2431,8 @@ unsigned int of_genpd_opp_to_performance_state(struct device *dev,
 
        opp = of_dev_pm_opp_find_required_opp(&genpd->dev, opp_node);
        if (IS_ERR(opp)) {
-               state = PTR_ERR(opp);
+               dev_err(dev, "Failed to find required OPP: %ld\n",
+                       PTR_ERR(opp));
                goto unlock;
        }