Merge tag 'v3.5-rc6' into irqdomain/next
authorGrant Likely <grant.likely@secretlab.ca>
Wed, 11 Jul 2012 15:08:35 +0000 (16:08 +0100)
committerGrant Likely <grant.likely@secretlab.ca>
Wed, 11 Jul 2012 15:08:35 +0000 (16:08 +0100)
Linux 3.5-rc6

1  2 
arch/powerpc/platforms/pseries/iommu.c
drivers/of/base.c

@@@ -106,7 -106,7 +106,7 @@@ static int tce_build_pSeries(struct iom
                tcep++;
        }
  
-       if (tbl->it_type == TCE_PCI_SWINV_CREATE)
+       if (tbl->it_type & TCE_PCI_SWINV_CREATE)
                tce_invalidate_pSeries_sw(tbl, tces, tcep - 1);
        return 0;
  }
@@@ -121,7 -121,7 +121,7 @@@ static void tce_free_pSeries(struct iom
        while (npages--)
                *(tcep++) = 0;
  
-       if (tbl->it_type == TCE_PCI_SWINV_FREE)
+       if (tbl->it_type & TCE_PCI_SWINV_FREE)
                tce_invalidate_pSeries_sw(tbl, tces, tcep - 1);
  }
  
@@@ -1051,7 -1051,7 +1051,7 @@@ static void pci_dma_dev_setup_pSeriesLP
        if (!pdn || !PCI_DN(pdn)) {
                printk(KERN_WARNING "pci_dma_dev_setup_pSeriesLP: "
                       "no DMA window found for pci dev=%s dn=%s\n",
 -                               pci_name(dev), dn? dn->full_name : "<null>");
 +                               pci_name(dev), of_node_full_name(dn));
                return;
        }
        pr_debug("  parent is %s\n", pdn->full_name);
diff --combined drivers/of/base.c
@@@ -511,6 -511,22 +511,22 @@@ out
  }
  EXPORT_SYMBOL(of_find_node_with_property);
  
+ static const struct of_device_id *of_match_compat(const struct of_device_id *matches,
+                                                 const char *compat)
+ {
+       while (matches->name[0] || matches->type[0] || matches->compatible[0]) {
+               const char *cp = matches->compatible;
+               int len = strlen(cp);
+               if (len > 0 && of_compat_cmp(compat, cp, len) == 0)
+                       return matches;
+               matches++;
+       }
+       return NULL;
+ }
  /**
   * of_match_node - Tell if an device_node has a matching of_match structure
   *    @matches:       array of of device match structures to search in
  const struct of_device_id *of_match_node(const struct of_device_id *matches,
                                         const struct device_node *node)
  {
+       struct property *prop;
+       const char *cp;
        if (!matches)
                return NULL;
  
+       of_property_for_each_string(node, "compatible", prop, cp) {
+               const struct of_device_id *match = of_match_compat(matches, cp);
+               if (match)
+                       return match;
+       }
        while (matches->name[0] || matches->type[0] || matches->compatible[0]) {
                int match = 1;
                if (matches->name[0])
                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)
+               if (match && !matches->compatible[0])
                        return matches;
                matches++;
        }
@@@ -1173,7 -1195,7 +1195,7 @@@ static void of_alias_add(struct alias_p
        ap->stem[stem_len] = 0;
        list_add_tail(&ap->link, &aliases_lookup);
        pr_debug("adding DT alias:%s: stem=%s id=%i node=%s\n",
 -               ap->alias, ap->stem, ap->id, np ? np->full_name : NULL);
 +               ap->alias, ap->stem, ap->id, of_node_full_name(np));
  }
  
  /**