Skip to content

Commit

Permalink
Revert "ANDROID: Fix cpufreq stats table creation"
Browse files Browse the repository at this point in the history
 * We don't need the "fix", per cpu stats is created without it, what's
   worse, it tried to create duplicated sysfs nodes.

This reverts commit f68f1c61baacc8c4a86f71c354f2081d2588d6c7.

Change-Id: I408f33609ce85bae9230707d7aad8874e4553cdc
  • Loading branch information
moetayuko authored and RahifM committed Jul 20, 2020
1 parent 6ffb3b5 commit 7be6872
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions drivers/cpufreq/cpufreq_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -577,11 +577,12 @@ static void cpufreq_powerstats_free(void)
}

static int __cpufreq_stats_create_table(struct cpufreq_policy *policy,
int cpu, struct cpufreq_frequency_table *table, int count)
struct cpufreq_frequency_table *table, int count)
{
unsigned int i, ret = 0;
struct cpufreq_stats *stat;
unsigned int alloc_size;
unsigned int cpu = policy->cpu;
struct cpufreq_frequency_table *pos;

if (per_cpu(cpufreq_stats_table, cpu))
Expand All @@ -591,6 +592,8 @@ static int __cpufreq_stats_create_table(struct cpufreq_policy *policy,
return -ENOMEM;

ret = sysfs_create_group(&policy->kobj, &stats_attr_group);
if (ret)
goto error_out;

stat->cpu = cpu;
per_cpu(cpufreq_stats_table, cpu) = stat;
Expand Down Expand Up @@ -623,6 +626,7 @@ static int __cpufreq_stats_create_table(struct cpufreq_policy *policy,
return 0;
error_alloc:
sysfs_remove_group(&policy->kobj, &stats_attr_group);
error_out:
kfree(stat);
per_cpu(cpufreq_stats_table, cpu) = NULL;
return ret;
Expand Down Expand Up @@ -801,7 +805,7 @@ static void cpufreq_stats_create_table(unsigned int cpu)
if (!per_cpu(cpufreq_power_stats, cpu))
cpufreq_powerstats_create(cpu, table, count);

__cpufreq_stats_create_table(policy, cpu, table, count);
__cpufreq_stats_create_table(policy, table, count);
}
cpufreq_cpu_put(policy);
}
Expand Down Expand Up @@ -859,7 +863,7 @@ static int cpufreq_stat_notifier_policy(struct notifier_block *nb,
}

if (val == CPUFREQ_CREATE_POLICY)
ret = __cpufreq_stats_create_table(policy, cpu, table, count);
ret = __cpufreq_stats_create_table(policy, table, count);

return ret;
}
Expand Down

0 comments on commit 7be6872

Please sign in to comment.