Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / arch / arm / kernel / bios32.c
index ad26e98..de606df 100644 (file)
@@ -447,9 +447,26 @@ pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
        region->end   = res->end - offset;
 }
 
+void __devinit
+pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
+                       struct pci_bus_region *region)
+{
+       struct pci_sys_data *root = dev->sysdata;
+       unsigned long offset = 0;
+
+       if (res->flags & IORESOURCE_IO)
+               offset = root->io_offset;
+       if (res->flags & IORESOURCE_MEM)
+               offset = root->mem_offset;
+
+       res->start = region->start + offset;
+       res->end   = region->end + offset;
+}
+
 #ifdef CONFIG_HOTPLUG
 EXPORT_SYMBOL(pcibios_fixup_bus);
 EXPORT_SYMBOL(pcibios_resource_to_bus);
+EXPORT_SYMBOL(pcibios_bus_to_resource);
 #endif
 
 /*
@@ -523,12 +540,10 @@ static void __init pcibios_init_hw(struct hw_pci *hw)
        int nr, busnr;
 
        for (nr = busnr = 0; nr < hw->nr_controllers; nr++) {
-               sys = kmalloc(sizeof(struct pci_sys_data), GFP_KERNEL);
+               sys = kzalloc(sizeof(struct pci_sys_data), GFP_KERNEL);
                if (!sys)
                        panic("PCI: unable to allocate sys data!");
 
-               memset(sys, 0, sizeof(struct pci_sys_data));
-
                sys->hw      = hw;
                sys->busnr   = busnr;
                sys->swizzle = hw->swizzle;