]> git.karo-electronics.de Git - karo-tx-linux.git/commit
cpufreq: governor: Use common mutex for dbs_data protection
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sun, 7 Feb 2016 15:01:31 +0000 (16:01 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 9 Feb 2016 20:34:51 +0000 (21:34 +0100)
commitd9809210f20baf7070a8d2fa0b1be777f8d678fd
tree1cb099d96daffd8813b129e209937c329f14236f
parent0144fa03ef4606aeb2c9b3a43be468abfaf2459f
cpufreq: governor: Use common mutex for dbs_data protection

Every governor relying on the common code in cpufreq_governor.c
has to provide its own mutex in struct common_dbs_data.  However,
there actually is no need to have a separate mutex per governor
for this purpose, they may be using the same global mutex just
fine.  Accordingly, introduce a single common mutex for that and
drop the mutex field from struct common_dbs_data.

That at least will ensure that the mutex is always present and
initialized regardless of what the particular governors do.

Another benefit is that the common code does not need a pointer to
a governor-related structure to get to the mutex which sometimes
helps.

Finally, it makes the code generally easier to follow.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Saravana Kannan <skannan@codeaurora.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/cpufreq/cpufreq_conservative.c
drivers/cpufreq/cpufreq_governor.c
drivers/cpufreq/cpufreq_governor.h
drivers/cpufreq/cpufreq_ondemand.c