diff mbox series

[V2] PM / Domain: Return 0 on error from of_genpd_opp_to_performance_state()

Message ID 2be9323571538a7c78656c5bb4ba6eb76b2d7b8f.1527157905.git.viresh.kumar@linaro.org
State Accepted
Commit 9ad14c001651955ebc390a5bb56858b0ee27ec2d
Headers show
Series [V2] PM / Domain: Return 0 on error from of_genpd_opp_to_performance_state() | expand

Commit Message

Viresh Kumar May 24, 2018, 10:32 a.m. UTC
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>

---
V2: s/%d/%ld to fix the warning which I missed in V1.

 drivers/base/power/domain.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

-- 
2.15.0.194.g9af6a3dea062
diff mbox series

Patch

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 29e25dc0584c..e30d4528aef2 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -2446,7 +2446,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;
 	}