]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge remote-tracking branch 'dt-rh/for-next'
authorStephen Rothwell <sfr@canb.auug.org.au>
Tue, 10 Dec 2013 01:39:42 +0000 (12:39 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 10 Dec 2013 01:39:42 +0000 (12:39 +1100)
Documentation/devicetree/bindings/arm/gic.txt
MAINTAINERS
drivers/of/base.c
drivers/of/irq.c

index 3dfb0c0384f572c45cc3df9e6fe92d6c6212bc89..bae0d87a38b2bb4c6577e2a597c0ac7f501d1b2b 100644 (file)
@@ -11,6 +11,7 @@ have PPIs or SGIs.
 Main node required properties:
 
 - compatible : should be one of:
+       "arm,gic-400"
        "arm,cortex-a15-gic"
        "arm,cortex-a9-gic"
        "arm,cortex-a7-gic"
index 6fdfc6e18de986a284363e8f412e86db62a45982..f5c30bb06886531a74ee240897bee7af162f159b 100644 (file)
@@ -6238,7 +6238,7 @@ F:        drivers/i2c/busses/i2c-ocores.c
 
 OPEN FIRMWARE AND FLATTENED DEVICE TREE
 M:     Grant Likely <grant.likely@linaro.org>
-M:     Rob Herring <rob.herring@calxeda.com>
+M:     Rob Herring <robh+dt@kernel.org>
 L:     devicetree@vger.kernel.org
 W:     http://fdt.secretlab.ca
 T:     git git://git.secretlab.ca/git/linux-2.6.git
@@ -6250,7 +6250,7 @@ K:        of_get_property
 K:     of_match_table
 
 OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
-M:     Rob Herring <rob.herring@calxeda.com>
+M:     Rob Herring <robh+dt@kernel.org>
 M:     Pawel Moll <pawel.moll@arm.com>
 M:     Mark Rutland <mark.rutland@arm.com>
 M:     Ian Campbell <ijc+devicetree@hellion.org.uk>
index f807d0edabf3206561bbcefa6009bb1d0fc89c1a..8d007d8b8c780e36e0f471f0329b9a140e401a0b 100644 (file)
@@ -731,24 +731,42 @@ static
 const struct of_device_id *__of_match_node(const struct of_device_id *matches,
                                           const struct device_node *node)
 {
+       const char *cp;
+       int cplen, l;
+
        if (!matches)
                return NULL;
 
-       while (matches->name[0] || matches->type[0] || matches->compatible[0]) {
-               int match = 1;
-               if (matches->name[0])
-                       match &= node->name
-                               && !strcmp(matches->name, node->name);
-               if (matches->type[0])
-                       match &= node->type
-                               && !strcmp(matches->type, node->type);
-               if (matches->compatible[0])
-                       match &= __of_device_is_compatible(node,
-                                                          matches->compatible);
-               if (match)
-                       return matches;
-               matches++;
-       }
+       cp = __of_get_property(node, "compatible", &cplen);
+       do {
+               const struct of_device_id *m = matches;
+
+               /* Check against matches with current compatible string */
+               while (m->name[0] || m->type[0] || m->compatible[0]) {
+                       int match = 1;
+                       if (m->name[0])
+                               match &= node->name
+                                       && !strcmp(m->name, node->name);
+                       if (m->type[0])
+                               match &= node->type
+                                       && !strcmp(m->type, node->type);
+                       if (m->compatible[0])
+                               match &= cp
+                                       && !of_compat_cmp(m->compatible, cp,
+                                                       strlen(m->compatible));
+                       if (match)
+                               return m;
+                       m++;
+               }
+
+               /* Get node's next compatible string */ 
+               if (cp) {
+                       l = strlen(cp) + 1;
+                       cp += l;
+                       cplen -= l;
+               }
+       } while (cp && (cplen > 0));
+
        return NULL;
 }
 
@@ -757,7 +775,10 @@ const struct of_device_id *__of_match_node(const struct of_device_id *matches,
  *     @matches:       array of of device match structures to search in
  *     @node:          the of device structure to match against
  *
- *     Low level utility function used by device matching.
+ *     Low level utility function used by device matching. Matching order
+ *     is to compare each of the node's compatibles with all given matches
+ *     first. This implies node's compatible is sorted from specific to
+ *     generic while matches can be in any order.
  */
 const struct of_device_id *of_match_node(const struct of_device_id *matches,
                                         const struct device_node *node)
index 786b0b47fae46802503ecbecee5719887830c44c..bf8026895c5e07e41c802f2ed1fb5775380edbaa 100644 (file)
@@ -217,6 +217,9 @@ int of_irq_parse_raw(const __be32 *addr, struct of_phandle_args *out_irq)
                                goto fail;
                        }
 
+                       if (!of_device_is_available(newpar))
+                               match = 0;
+
                        /* Get #interrupt-cells and #address-cells of new
                         * parent
                         */
@@ -438,7 +441,8 @@ void __init of_irq_init(const struct of_device_id *matches)
        INIT_LIST_HEAD(&intc_parent_list);
 
        for_each_matching_node(np, matches) {
-               if (!of_find_property(np, "interrupt-controller", NULL))
+               if (!of_find_property(np, "interrupt-controller", NULL) ||
+                               !of_device_is_available(np))
                        continue;
                /*
                 * Here, we allocate and populate an intc_desc with the node