[POWERPC] Rename get_property to of_get_property: arch/powerpc
[powerpc.git] / arch / powerpc / platforms / powermac / pci.c
index 9923adc..092cef4 100644 (file)
@@ -48,7 +48,6 @@ static struct pci_controller *u3_ht;
 static int has_second_ohare;
 #endif /* CONFIG_PPC64 */
 
-extern u8 pci_cache_line_size;
 extern int pcibios_assign_bus_offset;
 
 struct device_node *k2_skiplist[2];
@@ -71,11 +70,11 @@ static int __init fixup_one_level_bus_range(struct device_node *node, int higher
                int len;
 
                /* For PCI<->PCI bridges or CardBus bridges, we go down */
-               class_code = get_property(node, "class-code", NULL);
+               class_code = of_get_property(node, "class-code", NULL);
                if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI &&
                        (*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS))
                        continue;
-               bus_range = get_property(node, "bus-range", &len);
+               bus_range = of_get_property(node, "bus-range", &len);
                if (bus_range != NULL && len > 2 * sizeof(int)) {
                        if (bus_range[1] > higher)
                                higher = bus_range[1];
@@ -101,7 +100,7 @@ static void __init fixup_bus_range(struct device_node *bridge)
        if (prop == NULL || prop->length < 2 * sizeof(int))
                return;
 
-       bus_range = (int *)prop->value;
+       bus_range = prop->value;
        bus_range[1] = fixup_one_level_bus_range(bridge->child, bus_range[1]);
 }
 
@@ -247,8 +246,8 @@ static int chaos_validate_dev(struct pci_bus *bus, int devfn, int offset)
        if (np == NULL)
                return PCIBIOS_DEVICE_NOT_FOUND;
 
-       vendor = get_property(np, "vendor-id", NULL);
-       device = get_property(np, "device-id", NULL);
+       vendor = of_get_property(np, "vendor-id", NULL);
+       device = of_get_property(np, "device-id", NULL);
        if (vendor == NULL || device == NULL)
                return PCIBIOS_DEVICE_NOT_FOUND;
 
@@ -692,17 +691,17 @@ static void __init fixup_nec_usb2(void)
                const u32 *prop;
                u8 bus, devfn;
 
-               prop = get_property(nec, "vendor-id", NULL);
+               prop = of_get_property(nec, "vendor-id", NULL);
                if (prop == NULL)
                        continue;
                if (0x1033 != *prop)
                        continue;
-               prop = get_property(nec, "device-id", NULL);
+               prop = of_get_property(nec, "device-id", NULL);
                if (prop == NULL)
                        continue;
                if (0x0035 != *prop)
                        continue;
-               prop = get_property(nec, "reg", NULL);
+               prop = of_get_property(nec, "reg", NULL);
                if (prop == NULL)
                        continue;
                devfn = (prop[0] >> 8) & 0xff;
@@ -910,7 +909,7 @@ static int __init add_bridge(struct device_node *dev)
        has_address = (of_address_to_resource(dev, 0, &rsrc) == 0);
 
        /* Get bus range if any */
-       bus_range = get_property(dev, "bus-range", &len);
+       bus_range = of_get_property(dev, "bus-range", &len);
        if (bus_range == NULL || len < 2 * sizeof(int)) {
                printk(KERN_WARNING "Can't get bus-range for %s, assume"
                       " bus 0\n", dev->full_name);
@@ -985,30 +984,23 @@ static int __init add_bridge(struct device_node *dev)
        return 0;
 }
 
-void __init pmac_pcibios_fixup(void)
+void __devinit pmac_pci_irq_fixup(struct pci_dev *dev)
 {
-       struct pci_dev* dev = NULL;
-
-       for_each_pci_dev(dev) {
-               /* Read interrupt from the device-tree */
-               pci_read_irq_line(dev);
-
 #ifdef CONFIG_PPC32
-               /* Fixup interrupt for the modem/ethernet combo controller.
-                * on machines with a second ohare chip.
-                * The number in the device tree (27) is bogus (correct for
-                * the ethernet-only board but not the combo ethernet/modem
-                * board). The real interrupt is 28 on the second controller
-                * -> 28+32 = 60.
-                */
-               if (has_second_ohare &&
-                   dev->vendor == PCI_VENDOR_ID_DEC &&
-                   dev->device == PCI_DEVICE_ID_DEC_TULIP_PLUS) {
-                       dev->irq = irq_create_mapping(NULL, 60);
-                       set_irq_type(dev->irq, IRQ_TYPE_LEVEL_LOW);
-               }
-#endif /* CONFIG_PPC32 */
+       /* Fixup interrupt for the modem/ethernet combo controller.
+        * on machines with a second ohare chip.
+        * The number in the device tree (27) is bogus (correct for
+        * the ethernet-only board but not the combo ethernet/modem
+        * board). The real interrupt is 28 on the second controller
+        * -> 28+32 = 60.
+        */
+       if (has_second_ohare &&
+           dev->vendor == PCI_VENDOR_ID_DEC &&
+           dev->device == PCI_DEVICE_ID_DEC_TULIP_PLUS) {
+               dev->irq = irq_create_mapping(NULL, 60);
+               set_irq_type(dev->irq, IRQ_TYPE_LEVEL_LOW);
        }
+#endif /* CONFIG_PPC32 */
 }
 
 #ifdef CONFIG_PPC64
@@ -1199,8 +1191,11 @@ void __init pmac_pcibios_after_init(void)
         * -- BenH
         */
        for_each_pci_dev(dev) {
-               if ((dev->class >> 16) == PCI_BASE_CLASS_STORAGE)
-                       pci_enable_device(dev);
+               if ((dev->class >> 16) != PCI_BASE_CLASS_STORAGE)
+                       continue;
+               if (pci_enable_device(dev))
+                       printk(KERN_WARNING
+                              "pci: Failed to enable %s\n", pci_name(dev));
        }
 #endif /* CONFIG_BLK_DEV_IDE */