]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/sparc64/kernel/pci_common.c
[SPARC64]: Fix sparse warnings in arch/sparc64/kernel/irq.c
[linux-2.6-omap-h63xx.git] / arch / sparc64 / kernel / pci_common.c
index 2f61c4b1259606ee45ab004cd8e10d91bcb3b5ae..923e0bcc3bfdb0e65cdb6b957324957aa886040a 100644 (file)
@@ -264,7 +264,7 @@ static int sun4v_read_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
        unsigned int func = PCI_FUNC(devfn);
        unsigned long ret;
 
-       if (bus_dev == pbm->pci_bus && devfn == 0x00)
+       if (!bus && devfn == 0x00)
                return pci_host_bridge_read_pci_cfg(bus_dev, devfn, where,
                                                    size, value);
        if (config_out_of_range(pbm, bus, devfn, where)) {
@@ -300,7 +300,7 @@ static int sun4v_write_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
        unsigned int func = PCI_FUNC(devfn);
        unsigned long ret;
 
-       if (bus_dev == pbm->pci_bus && devfn == 0x00)
+       if (!bus && devfn == 0x00)
                return pci_host_bridge_write_pci_cfg(bus_dev, devfn, where,
                                                     size, value);
        if (config_out_of_range(pbm, bus, devfn, where)) {
@@ -396,6 +396,13 @@ void pci_determine_mem_io_space(struct pci_pbm_info *pbm)
 
        saw_mem = saw_io = 0;
        pbm_ranges = of_get_property(pbm->prom_node, "ranges", &i);
+       if (!pbm_ranges) {
+               prom_printf("PCI: Fatal error, missing PBM ranges property "
+                           " for %s\n",
+                           pbm->name);
+               prom_halt();
+       }
+
        num_pbm_ranges = i / sizeof(*pbm_ranges);
 
        for (i = 0; i < num_pbm_ranges; i++) {