cpufreq: governors: Fix WARN_ON() for multi-policy platforms
authorViresh Kumar <viresh.kumar@linaro.org>
Thu, 7 Feb 2013 07:21:27 +0000 (12:51 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sat, 9 Feb 2013 00:21:13 +0000 (01:21 +0100)
commit8e53695f7f1d005fd1fcd3b099cd1bd73683a9f5
tree12fea44f84d19819b8b07c1b1e8dcaf0a5952e00
parent4bd4e42819c7b5b2d608b353f4d9a7717e586479
cpufreq: governors: Fix WARN_ON() for multi-policy platforms

On multi-policy systems there is a single instance of governor for both the
policies (if same governor is chosen for both policies). With the code update
from following patches:

8eeed09 cpufreq: governors: Get rid of dbs_data->enable field
b394058 cpufreq: governors: Reset tunables only for cpufreq_unregister_governor()

We are creating/removing sysfs directory of governor for for every call to
GOV_START and STOP. This would fail for multi-policy system as there is a
per-policy call to START/STOP.

This patch reuses the governor->initialized variable to detect total users of
governor.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/cpufreq.c
drivers/cpufreq/cpufreq_governor.c