From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [RFC PATCH v3 07/12] arch/arm: create device tree nodes for hwdom cpufreq cpu driver Date: Mon, 27 Oct 2014 13:15:48 +0000 Message-ID: <544E4584.30003@linaro.org> References: <1414076867-2148-1-git-send-email-oleksandr.dmytryshyn@globallogic.com> <1414076867-2148-8-git-send-email-oleksandr.dmytryshyn@globallogic.com> <54492385.5030602@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Oleksandr Dmytryshyn Cc: Stefano Stabellini , Tim Deegan , Ian Campbell , xen-devel List-Id: xen-devel@lists.xenproject.org Hi Oleksandr, On 10/27/2014 10:52 AM, Oleksandr Dmytryshyn wrote: > On Fri, Oct 24, 2014 at 1:24 PM, Oleksandr Dmytryshyn > wrote: >> On Thu, Oct 23, 2014 at 6:49 PM, Julien Grall wrote: >>>> + >>>> + DPRINT("Copy %s node to the pcpus\n", node_name); >>>> + >>>> + res = fdt_begin_node(fdt, node_name); >>>> + if ( res ) >>>> + return res; >>>> + >>>> + dt_for_each_property_node( npcpu, pp ) >>>> + { >>>> + if ( pp->length ) >>>> + { >>>> + res = fdt_property(fdt, pp->name, pp->value, >>>> + pp->length); >>>> + if ( res ) >>>> + return res; >>>> + } >>>> + } >>>> + >>> >>> You can use write_properties to replace this loop. >> I'll try to do this in the next patch set. > It is better to keep this loop because write_properties() replaces only loop > and this function contains additional checkings. Those checking are only for the "chosen" node. This function is used in place where we have to copy properties in DOM0 DT. Not sure why you think it would not fit here? BTW, we plan to rework this function for Xen 4.6. The function will likely look like to your open loop. > Also this function passes > kernel_info * parameter which is absent in the function make_hypervisor_node(). > kinfo->fdt is passed as the parameter to the the function > make_hypervisor_node(). The prototype of make_hypervisor_node is not set in stone :). It's perfectly fine to pass kinfo in parameter. Regards, -- Julien Grall