From: Chander Kashyap Date: Fri, 16 May 2014 10:51:17 +0000 (+0530) Subject: PM / OPP: fix incorrect OPP count handling in of_init_opp_table X-Git-Tag: v3.14.10~43 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=703d671298a54a293776aa88474b601fc480292a;p=profile%2Fcommon%2Fkernel-common.git PM / OPP: fix incorrect OPP count handling in of_init_opp_table commit 086abb58590a4df73e8a6ed71fd418826937cd46 upstream. In of_init_opp_table function, if a failure to add an OPP is detected, the count of OPPs, yet to be added is not updated. Fix this by decrementing this count on failure as well. Signed-off-by: Chander Kashyap Signed-off-by: Inderpal Singh Acked-by: Viresh Kumar Acked-by: Nishanth Menon Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c index fa41874..08d99ef 100644 --- a/drivers/base/power/opp.c +++ b/drivers/base/power/opp.c @@ -735,11 +735,9 @@ int of_init_opp_table(struct device *dev) unsigned long freq = be32_to_cpup(val++) * 1000; unsigned long volt = be32_to_cpup(val++); - if (dev_pm_opp_add(dev, freq, volt)) { + if (dev_pm_opp_add(dev, freq, volt)) dev_warn(dev, "%s: Failed to add OPP %ld\n", __func__, freq); - continue; - } nr -= 2; }