diff mbox

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

Message ID 2be9323571538a7c78656c5bb4ba6eb76b2d7b8f.1527157905.git.viresh.kumar@linaro.org (mailing list archive)
State Mainlined
Delegated to: Rafael Wysocki
Headers show

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(-)
diff mbox

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;
 	}