mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
cpufreq: interactive: fix cpufreq object duplicate creatation in sysfs
[ 4.216722] sysfs: cannot create duplicate filename '/devices/system/cpu/cpufreq'
[ 4.233798] ------------[ cut here ]------------
[ 4.244376] WARNING: at fs/sysfs/dir.c:31
[ 4.253556]
[ 4.256975] CPU: 3 PID: 1 Comm: swapper/0 Not tainted 4.4.0 #156
[ 4.270730] Hardware name: Rockchip SDK tb board (DT)
[ 4.282302] task: ffffffc039670000 ti: ffffffc039678000 task.ti: ffffffc039678000
[ 4.299444] PC is at sysfs_warn_dup+0x5c/0x78
[ 4.309422] LR is at sysfs_warn_dup+0x5c/0x78
Change-Id: Id21fe74dc082ec6c94fcb3e0cc11b78226549f7d
Fixes: bc68f6c4ef ("cpufreq: interactive: build fixes for 4.4")
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
This commit is contained in:
@@ -116,28 +116,6 @@ 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;
|
||||
|
||||
@@ -1172,7 +1150,6 @@ static int cpufreq_governor_interactive(struct cpufreq_policy *policy,
|
||||
policy->governor_data = tunables;
|
||||
if (!have_governor_per_policy()) {
|
||||
common_tunables = tunables;
|
||||
WARN_ON(cpufreq_get_global_kobject());
|
||||
}
|
||||
|
||||
rc = sysfs_create_group(get_governor_parent_kobj(policy),
|
||||
@@ -1182,7 +1159,6 @@ static int cpufreq_governor_interactive(struct cpufreq_policy *policy,
|
||||
policy->governor_data = NULL;
|
||||
if (!have_governor_per_policy()) {
|
||||
common_tunables = NULL;
|
||||
cpufreq_put_global_kobject();
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
@@ -1206,8 +1182,6 @@ static int cpufreq_governor_interactive(struct cpufreq_policy *policy,
|
||||
sysfs_remove_group(get_governor_parent_kobj(policy),
|
||||
get_sysfs_attr());
|
||||
|
||||
if (!have_governor_per_policy())
|
||||
cpufreq_put_global_kobject();
|
||||
|
||||
kfree(tunables);
|
||||
common_tunables = NULL;
|
||||
|
||||
Reference in New Issue
Block a user