]> err.no Git - linux-2.6/commitdiff
[POWERPC] maple: improve CPC9x5 host bridge detection
authorNathan Lynch <ntl@pobox.com>
Wed, 3 Jan 2007 18:56:28 +0000 (12:56 -0600)
committerPaul Mackerras <paulus@samba.org>
Wed, 24 Jan 2007 10:13:58 +0000 (21:13 +1100)
Identify CPC9x5 PCI Express, AGP, and HT host bridges using
device_type and compatible properties, which is a more flexible method
than using the name property (which can differ between firmwares and
models).

Signed-off-by: Nathan Lynch <ntl@pobox.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/platforms/maple/pci.c

index 3f6a69f67195a0e7172a072925d6461eedc388fa..011f0f14f0f288c916b6190c4c464efb6752bc30 100644 (file)
@@ -560,13 +560,16 @@ void __init maple_pci_init(void)
                return;
        }
        for (np = NULL; (np = of_get_next_child(root, np)) != NULL;) {
-               if (np->name == NULL)
+               if (!np->type)
                        continue;
-               if (!strcmp(np->name, "pci") || !strcmp(np->name, "pcie")) {
-                       if (add_bridge(np) == 0)
-                               of_node_get(np);
-               }
-               if (strcmp(np->name, "ht") == 0) {
+               if (strcmp(np->type, "pci") && strcmp(np->type, "ht"))
+                       continue;
+               if ((device_is_compatible(np, "u4-pcie") ||
+                    device_is_compatible(np, "u3-agp")) &&
+                   add_bridge(np) == 0)
+                       of_node_get(np);
+
+               if (device_is_compatible(np, "u3-ht")) {
                        of_node_get(np);
                        ht = np;
                }