PM / OPP: Don't allocate OPP table from _opp_allocate()
authorViresh Kumar <viresh.kumar@linaro.org>
Mon, 2 Jan 2017 09:11:01 +0000 (14:41 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 27 Jan 2017 10:49:09 +0000 (11:49 +0100)
commit8cd2f6e8f34e75198063a6d84675b18bdb106824
tree14991808bbed7c59afdcdbe90dfd2434e85cc051
parent9274c892430ef3240acf3f336916f64fe2b67b02
PM / OPP: Don't allocate OPP table from _opp_allocate()

There is no point in trying to find/allocate the table for every OPP
that is added for a device. It would be far more efficient to allocate
the table only once and pass its pointer to the routines that add the
OPP entry.

Locking is removed from _opp_add_static_v2() and _opp_add_v1() now as
the callers call them with that lock already held.

Call to _remove_opp_table() routine is also removed from _opp_free()
now, as opp_table isn't allocated from within _opp_allocate(). This is
handled by the routines which created the OPP table in the first place.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/power/opp/core.c
drivers/base/power/opp/of.c
drivers/base/power/opp/opp.h