cpufreq: governor: Get rid of governor events
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 2 Jun 2016 21:24:15 +0000 (23:24 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 2 Jun 2016 21:24:15 +0000 (23:24 +0200)
commite788892ba3cc71d385b75895f7a375fbc659ce86
treef8a66153a91408f050eb7eb8d909c98d85a75ba9
parenta92604b419f47e1c5098632742d8e031f6e8fab1
cpufreq: governor: Get rid of governor events

The design of the cpufreq governor API is not very straightforward,
as struct cpufreq_governor provides only one callback to be invoked
from different code paths for different purposes.  The purpose it is
invoked for is determined by its second "event" argument, causing it
to act as a "callback multiplexer" of sorts.

Unfortunately, that leads to extra complexity in governors, some of
which implement the ->governor() callback as a switch statement
that simply checks the event argument and invokes a separate function
to handle that specific event.

That extra complexity can be eliminated by replacing the all-purpose
->governor() callback with a family of callbacks to carry out specific
governor operations: initialization and exit, start and stop and policy
limits updates.  That also turns out to reduce the code size too, so
do it.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
arch/powerpc/platforms/cell/cpufreq_spudemand.c
drivers/cpufreq/cpufreq.c
drivers/cpufreq/cpufreq_conservative.c
drivers/cpufreq/cpufreq_governor.c
drivers/cpufreq/cpufreq_governor.h
drivers/cpufreq/cpufreq_ondemand.c
drivers/cpufreq/cpufreq_performance.c
drivers/cpufreq/cpufreq_powersave.c
drivers/cpufreq/cpufreq_userspace.c
include/linux/cpufreq.h
kernel/sched/cpufreq_schedutil.c