diff options
author | Chander Kashyap <chander.kashyap@linaro.org> | 2014-05-16 06:51:17 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-05-19 17:02:36 -0400 |
commit | 086abb58590a4df73e8a6ed71fd418826937cd46 (patch) | |
tree | c388704c9302c58a0b0e144cbb3ac11c5056f5fd /drivers/base | |
parent | d6d211db37e75de2ddc3a4f979038c40df7cc79c (diff) |
PM / OPP: fix incorrect OPP count handling in of_init_opp_table
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 <k.chander@samsung.com>
Signed-off-by: Inderpal Singh <inderpal.s@samsung.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Cc: 3.7+ <stable@vger.kernel.org> # 3.7+
Acked-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/power/opp.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c index 25538675d59e..c539d70b97ab 100644 --- a/drivers/base/power/opp.c +++ b/drivers/base/power/opp.c | |||
@@ -734,11 +734,9 @@ int of_init_opp_table(struct device *dev) | |||
734 | unsigned long freq = be32_to_cpup(val++) * 1000; | 734 | unsigned long freq = be32_to_cpup(val++) * 1000; |
735 | unsigned long volt = be32_to_cpup(val++); | 735 | unsigned long volt = be32_to_cpup(val++); |
736 | 736 | ||
737 | if (dev_pm_opp_add(dev, freq, volt)) { | 737 | if (dev_pm_opp_add(dev, freq, volt)) |
738 | dev_warn(dev, "%s: Failed to add OPP %ld\n", | 738 | dev_warn(dev, "%s: Failed to add OPP %ld\n", |
739 | __func__, freq); | 739 | __func__, freq); |
740 | continue; | ||
741 | } | ||
742 | nr -= 2; | 740 | nr -= 2; |
743 | } | 741 | } |
744 | 742 | ||