Commit 99a19c78 authored by Chander Kashyap's avatar Chander Kashyap Committed by Kamal Mostafa

PM / OPP: fix incorrect OPP count handling in of_init_opp_table

commit 086abb58 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: default avatarChander Kashyap <k.chander@samsung.com>
Signed-off-by: default avatarInderpal Singh <inderpal.s@samsung.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Acked-by: default avatarNishanth Menon <nm@ti.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
parent 97dd5de1
...@@ -735,11 +735,9 @@ int of_init_opp_table(struct device *dev) ...@@ -735,11 +735,9 @@ int of_init_opp_table(struct device *dev)
unsigned long freq = be32_to_cpup(val++) * 1000; unsigned long freq = be32_to_cpup(val++) * 1000;
unsigned long volt = be32_to_cpup(val++); 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", dev_warn(dev, "%s: Failed to add OPP %ld\n",
__func__, freq); __func__, freq);
continue;
}
nr -= 2; nr -= 2;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment