]> xenbits.xensource.com Git - xen.git/commitdiff
xen/dts: dt_find_interrupt_controller: accept multiple compatible strings
authorJulien Grall <julien.grall@linaro.org>
Fri, 13 Sep 2013 12:49:19 +0000 (13:49 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 17 Sep 2013 14:28:23 +0000 (15:28 +0100)
Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/gic.c
xen/common/device_tree.c
xen/include/asm-arm/gic.h
xen/include/xen/device_tree.h

index 7c248115101985def10eaf094ff39cf9c78ecd31..aff57b933844992a32139ac1c2ddf88278cf663d 100644 (file)
@@ -355,10 +355,15 @@ int gic_irq_xlate(const u32 *intspec, unsigned int intsize,
 /* Set up the GIC */
 void __init gic_init(void)
 {
+    static const struct dt_device_match gic_ids[] __initconst =
+    {
+        DT_MATCH_GIC,
+        { /* sentinel */ },
+    };
     struct dt_device_node *node;
     int res;
 
-    node = dt_find_interrupt_controller("arm,cortex-a15-gic");
+    node = dt_find_interrupt_controller(gic_ids);
     if ( !node )
         panic("Unable to find compatible GIC in the device tree\n");
 
index d2262ce31f6fcd7f89d98d021674982a664bde74..215592e84e7c175b1ac2741a46f250c9b193b7bf 100644 (file)
@@ -1834,11 +1834,12 @@ static void __init dt_alias_scan(void)
     }
 }
 
-struct dt_device_node * __init dt_find_interrupt_controller(const char *compat)
+struct dt_device_node * __init
+dt_find_interrupt_controller(const struct dt_device_match *matches)
 {
     struct dt_device_node *np = NULL;
 
-    while ( (np = dt_find_compatible_node(np, NULL, compat)) )
+    while ( (np = dt_find_matching_node(np, matches)) )
     {
         if ( !dt_find_property(np, "interrupt-controller", NULL) )
             continue;
index 513c1fca6c8f0d12a561441735115d9a275745a2..92a3349c688ccd706b4179e20417a1064ff6a089 100644 (file)
 #ifndef __ASSEMBLY__
 #include <xen/device_tree.h>
 
+#define DT_MATCH_GIC    DT_MATCH_COMPATIBLE("arm,cortex-a15-gic")
+
 extern int domain_vgic_init(struct domain *d);
 extern void domain_vgic_free(struct domain *d);
 
index 5a51ab679da157795442de39f4da8799a6a9f665..fae9f972153348077ce7a59e52c0e0459fbd99f5 100644 (file)
@@ -240,7 +240,8 @@ extern const struct dt_device_node *dt_interrupt_controller;
  *
  * If found, return the interrupt controller device node.
  */
-struct dt_device_node * __init dt_find_interrupt_controller(const char *compat);
+struct dt_device_node * __init
+dt_find_interrupt_controller(const struct dt_device_match *matches);
 
 #define dt_prop_cmp(s1, s2) strcmp((s1), (s2))
 #define dt_node_cmp(s1, s2) strcasecmp((s1), (s2))