[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v6a 08/17] xen/arm: use device api to detect GIC version



Hi Vijay,

On 06/26/2014 06:34 AM, vijay.kilari@xxxxxxxxx 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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.