From bc68f6c4efbd4ddbb15817203f18b7941d9ffd52 Mon Sep 17 00:00:00 2001 From: Amit Pundir Date: Fri, 20 Nov 2015 18:54:30 +0530 Subject: [PATCH] cpufreq: interactive: build fixes for 4.4 Bring back cpufreq_{get,put}_global_kobject() definitions removed by upstream commit 8eec1020f0c0 "cpufreq: create cpu/cpufreq at boot time" to fix build failures. Signed-off-by: Amit Pundir --- drivers/cpufreq/cpufreq_interactive.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/cpufreq/cpufreq_interactive.c b/drivers/cpufreq/cpufreq_interactive.c index f2be0d87d73d..9259d4829765 100644 --- a/drivers/cpufreq/cpufreq_interactive.c +++ b/drivers/cpufreq/cpufreq_interactive.c @@ -116,6 +116,28 @@ struct cpufreq_interactive_tunables { bool io_is_busy; }; +/* + * HACK: FIXME: Bring back cpufreq_{get,put}_global_kobject() + * definition removed by upstream commit 8eec1020f0c0 "cpufreq: + * create cpu/cpufreq at boot time" to fix build failures. + */ +static int cpufreq_global_kobject_usage; + +int cpufreq_get_global_kobject(void) +{ + if (!cpufreq_global_kobject_usage++) + return kobject_add(cpufreq_global_kobject, + &cpu_subsys.dev_root->kobj, "%s", "cpufreq"); + + return 0; +} + +void cpufreq_put_global_kobject(void) +{ + if (!--cpufreq_global_kobject_usage) + kobject_del(cpufreq_global_kobject); +} + /* For cases where we have single governor instance for system */ static struct cpufreq_interactive_tunables *common_tunables; -- 2.34.1