Hi Geert,
On Thu, May 21, 2015 at 5:13 PM, Geert Uytterhoeven
<[email protected]> wrote:
> On Thu, May 21, 2015 at 3:22 AM, Magnus Damm <[email protected]> wrote:
>> --- 0001/arch/arm/mach-shmobile/platsmp-apmu.c
>> +++ work/arch/arm/mach-shmobile/platsmp-apmu.c 2015-05-20
>> 22:26:43.152366518 +0900
>
>> +static void apmu_parse_dt(void (*fn)(struct resource *res, int cpu, int
>> bit))
>> +{
>> + struct device_node *np_apmu, *np_cpu;
>> + struct resource res;
>> + u32 id;
>> + int bit, index;
>> + bool is_allowed;
>> +
>> + for_each_matching_node(np_apmu, apmu_ids) {
>> + /* only enable the cluster that includes the boot CPU */
>> + is_allowed = false;
>
> You can declare the variable here instead of at the top of the function.
Sure, good idea.
>> + for (bit = 0; bit < CONFIG_NR_CPUS; bit++) {
>> + np_cpu = of_parse_phandle(np_apmu, "cpus", bit);
>> + if (np_cpu) {
>> + if (!of_property_read_u32(np_cpu, "reg",
>> &id)) {
>> + if (id == cpu_logical_map(0))
>> + is_allowed = true;
>
> You can do "of_node_put(np_cpu); break;" here, to stop scanning.
Yes, that's correct. I did not manage to get this update into the V2
series but will do later on in V3.
Thanks!
/ magnus
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html