lkml.org 
[lkml]   [2014]   [Dec]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [RFC PATCH v6 6/9] thermal: cpu_cooling: implement the power cooling device API
On Mon, Dec 08, 2014 at 01:31:35PM +0000, Viresh Kumar wrote:
> On 8 December 2014 at 18:20, Javi Merino <javi.merino@arm.com> wrote:
> > Is this loop pointless? I seem to recall that it was needed but I
> > forgot the details. If you think it is, I can remove it.
>
> Yes it is pointless. The CPUs you are iterating on, share clock lines
> and so they will have same set of OPPs. Just do this for the cpu
> we are registering the cooling device.

Ok, changed it into:

cpu = cpumask_any(&cpufreq_device->allowed_cpus);
dev = get_cpu_device(cpu);
if (!dev) {
dev_warn(&cpufreq_device->cool_dev->device,
"No cpu device for cpu %d\n", cpu);
ret = -EINVAL;
goto unlock;
}

num_opps = dev_pm_opp_get_opp_count(dev);
if (num_opps <= 0) {
ret = (num_opps < 0)? num_opps : -EINVAL;
goto unlock;
}

Thanks!
Javi



\
 
 \ /
  Last update: 2014-12-08 16:01    [W:0.087 / U:0.740 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site