From: Zhang Rui Date: Mon, 15 Apr 2013 01:26:58 +0000 (+0800) Subject: Merge branch 'thermal' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux... X-Git-Tag: Ubuntu-5.10.0-12.13~19153^2~10 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=d13cb03aef0c062dcdd16b411bd4c02c1574ff08;p=mirror_ubuntu-hirsute-kernel.git Merge branch 'thermal' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux into next Conflicts: drivers/thermal/cpu_cooling.c --- d13cb03aef0c062dcdd16b411bd4c02c1574ff08 diff --cc drivers/thermal/cpu_cooling.c index be2e6b0e5349,e03891b03c9b..5f5c780bcd90 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c @@@ -235,31 -301,19 +301,19 @@@ static int cpufreq_get_max_state(struc 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; } /**