unsigned long *state)
{
struct cpufreq_cooling_device *cpufreq_device = cdev->devdata;
- struct cpumask *maskPtr = &cpufreq_device->allowed_cpus;
+ struct cpumask *mask = &cpufreq_device->allowed_cpus;
unsigned int cpu;
- struct cpufreq_frequency_table *table;
unsigned long count = 0;
- int i = 0;
+ int ret;
- cpu = cpumask_any(maskPtr);
+ cpu = cpumask_any(mask);
- table = cpufreq_frequency_get_table(cpu);
- if (!table) {
- *state = 0;
- return 0;
- }
- for (i = 0; (table[i].frequency != CPUFREQ_TABLE_END); i++) {
- if (table[i].frequency == CPUFREQ_ENTRY_INVALID)
- continue;
- count++;
- }
+ ret = get_property(cpu, 0, (unsigned int *)&count, GET_MAXL);
- if (count > 0) {
- *state = --count;
- return 0;
- }
+ if (count > 0)
+ *state = count;
- return -EINVAL;
+ return ret;
}
/**