Skip to content

Commit

Permalink
PM / OPP: fix incorrect OPP count handling in of_init_opp_table
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Chander Kashyap authored and Rafael J. Wysocki committed May 19, 2014
1 parent d6d211d commit 086abb5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/base/power/opp.c
Original file line number Diff line number Diff line change
Expand Up @@ -734,11 +734,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;
}

Expand Down

0 comments on commit 086abb5

Please sign in to comment.