From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v6a 08/17] xen/arm: use device api to detect GIC version Date: Thu, 26 Jun 2014 13:29:59 +0100 Message-ID: <53AC1247.5050200@linaro.org> References: <1403760849-14627-1-git-send-email-vijay.kilari@gmail.com> <1403760849-14627-9-git-send-email-vijay.kilari@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1403760849-14627-9-git-send-email-vijay.kilari@gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: vijay.kilari@gmail.com, Ian.Campbell@citrix.com, stefano.stabellini@eu.citrix.com, stefano.stabellini@citrix.com, tim@xen.org, xen-devel@lists.xen.org Cc: Prasun.Kapoor@caviumnetworks.com, vijaya.kumar@caviumnetworks.com List-Id: xen-devel@lists.xenproject.org Hi Vijay, On 06/26/2014 06:34 AM, vijay.kilari@gmail.com wrote: > @@ -164,7 +165,29 @@ int gic_irq_xlate(const u32 *intspec, unsigned int intsize, > /* Set up the GIC */ > void __init gic_init(void) > { > - gicv2_init(); > + int rc; > + struct dt_device_node *node; > + bool_t num_gics = 0; Sorry I didn't catch it earlier. Naming a boolean num_gics is odd. I would use unsigned int here, because the purpose of this variable is to count the number of GICs. Even though we support only 1 GIC for now. > + > + dt_for_each_device_node( dt_host, node ) > + { > + if ( !dt_get_property(node, "interrupt-controller", NULL) ) > + continue; > + > + if ( !dt_get_parent(node) ) > + continue; > + > + rc = device_init(node, DEVICE_GIC, NULL); > + if ( !rc ) > + { > + /* NOTE: Only one GIC is supported */ > + num_gics = 1; > + break; > + } > + } Regards, -- Julien Grall