Pull trivial1 into release branch
[pandora-kernel.git] / arch / ia64 / pci / pci.c
index 337abd5..ab829a2 100644 (file)
@@ -31,7 +31,6 @@
 #include <asm/irq.h>
 #include <asm/hw_irq.h>
 
-
 /*
  * Low-level SAL-based PCI configuration access functions. Note that SAL
  * calls are already serialized (via sal_lock), so we don't need another
@@ -454,14 +453,13 @@ static int __devinit is_valid_resource(struct pci_dev *dev, int idx)
        return 0;
 }
 
-static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev)
+static void __devinit
+pcibios_fixup_resources(struct pci_dev *dev, int start, int limit)
 {
        struct pci_bus_region region;
        int i;
-       int limit = (dev->hdr_type == PCI_HEADER_TYPE_NORMAL) ? \
-               PCI_BRIDGE_RESOURCES : PCI_NUM_RESOURCES;
 
-       for (i = 0; i < limit; i++) {
+       for (i = start; i < limit; i++) {
                if (!dev->resource[i].flags)
                        continue;
                region.start = dev->resource[i].start;
@@ -472,6 +470,16 @@ static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev)
        }
 }
 
+static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev)
+{
+       pcibios_fixup_resources(dev, 0, PCI_BRIDGE_RESOURCES);
+}
+
+static void __devinit pcibios_fixup_bridge_resources(struct pci_dev *dev)
+{
+       pcibios_fixup_resources(dev, PCI_BRIDGE_RESOURCES, PCI_NUM_RESOURCES);
+}
+
 /*
  *  Called after each bus is probed, but before its children are examined.
  */
@@ -482,7 +490,7 @@ pcibios_fixup_bus (struct pci_bus *b)
 
        if (b->self) {
                pci_read_bridge_bases(b);
-               pcibios_fixup_device_resources(b->self);
+               pcibios_fixup_bridge_resources(b->self);
        }
        list_for_each_entry(dev, &b->devices, bus_list)
                pcibios_fixup_device_resources(dev);
@@ -570,7 +578,7 @@ pcibios_align_resource (void *data, struct resource *res,
 char * __init
 pcibios_setup (char *str)
 {
-       return NULL;
+       return str;
 }
 
 int
@@ -698,7 +706,7 @@ int ia64_pci_legacy_read(struct pci_bus *bus, u16 port, u32 *val, u8 size)
  *
  * Simply writes @size bytes of @val to @port.
  */
-int ia64_pci_legacy_write(struct pci_dev *bus, u16 port, u32 val, u8 size)
+int ia64_pci_legacy_write(struct pci_bus *bus, u16 port, u32 val, u8 size)
 {
        int ret = size;