Pull thermal into release branch
[linux-drm-fsl-dcu.git] / arch / powerpc / kernel / pci_32.c
index ae04f9418363be2233ab5b09f2c948f78f2fc515..e66064b5093a2496ad2e03e9ebd1212ba98ad72b 100644 (file)
@@ -656,10 +656,13 @@ make_one_node_map(struct device_node* node, u8 pci_bus)
                reg = of_get_property(node, "reg", NULL);
                if (!reg)
                        continue;
-               dev = pci_find_slot(pci_bus, ((reg[0] >> 8) & 0xff));
-               if (!dev || !dev->subordinate)
+               dev = pci_get_bus_and_slot(pci_bus, ((reg[0] >> 8) & 0xff));
+               if (!dev || !dev->subordinate) {
+                       pci_dev_put(dev);
                        continue;
+               }
                make_one_node_map(node, dev->subordinate->number);
+               pci_dev_put(dev);
        }
 }
        
@@ -669,6 +672,7 @@ pcibios_make_OF_bus_map(void)
        int i;
        struct pci_controller* hose;
        struct property *map_prop;
+       struct device_node *dn;
 
        pci_to_OF_bus_map = kmalloc(pci_bus_count, GFP_KERNEL);
        if (!pci_to_OF_bus_map) {
@@ -690,12 +694,13 @@ pcibios_make_OF_bus_map(void)
                        continue;
                make_one_node_map(node, hose->first_busno);
        }
-       map_prop = of_find_property(find_path_device("/"),
-                       "pci-OF-bus-map", NULL);
+       dn = of_find_node_by_path("/");
+       map_prop = of_find_property(dn, "pci-OF-bus-map", NULL);
        if (map_prop) {
                BUG_ON(pci_bus_count > map_prop->length);
                memcpy(map_prop->value, pci_to_OF_bus_map, pci_bus_count);
        }
+       of_node_put(dn);
 #ifdef DEBUG
        printk("PCI->OF bus map:\n");
        for (i=0; i<pci_bus_count; i++) {
@@ -1006,14 +1011,19 @@ void __init
 pci_create_OF_bus_map(void)
 {
        struct property* of_prop;
-       
+       struct device_node *dn;
+
        of_prop = (struct property*) alloc_bootmem(sizeof(struct property) + 256);
-       if (of_prop && find_path_device("/")) {
+       if (!of_prop)
+               return;
+       dn = of_find_node_by_path("/");
+       if (dn) {
                memset(of_prop, -1, sizeof(struct property) + 256);
                of_prop->name = "pci-OF-bus-map";
                of_prop->length = 256;
                of_prop->value = &of_prop[1];
-               prom_add_property(find_path_device("/"), of_prop);
+               prom_add_property(dn, of_prop);
+               of_node_put(dn);
        }
 }
 
@@ -1648,7 +1658,7 @@ pgprot_t pci_phys_mem_access_prot(struct file *file,
        int i;
 
        if (page_is_ram(pfn))
-               return prot;
+               return __pgprot(prot);
 
        prot |= _PAGE_NO_CACHE | _PAGE_GUARDED;