PM / OPP: fix incorrect OPP count handling in of_init_opp_table
authorChander Kashyap <chander.kashyap@linaro.org>
Fri, 16 May 2014 10:51:17 +0000 (16:21 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Jul 2014 03:11:59 +0000 (20:11 -0700)
commit703d671298a54a293776aa88474b601fc480292a
treea067881ca021e6b09a1ec849133efffc075a39b3
parentd4a06c59dfeb4012c13a113a450de5cc07dbad36
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 <k.chander@samsung.com>
Signed-off-by: Inderpal Singh <inderpal.s@samsung.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/power/opp.c