]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - arch/arm/kernel/bios32.c
Merge branches 'pci/demodularize-hosts' and 'pci/host-request-windows' into next
[mirror_ubuntu-artful-kernel.git] / arch / arm / kernel / bios32.c
index af8e4668fbf909244b32233911ef201014190367..2f0e07735d1d4715234d94d6bd0e0d7c49f442c0 100644 (file)
@@ -410,7 +410,8 @@ static int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
        return irq;
 }
 
-static int pcibios_init_resources(int busnr, struct pci_sys_data *sys)
+static int pcibios_init_resource(int busnr, struct pci_sys_data *sys,
+                                int io_optional)
 {
        int ret;
        struct resource_entry *window;
@@ -420,6 +421,14 @@ static int pcibios_init_resources(int busnr, struct pci_sys_data *sys)
                         &iomem_resource, sys->mem_offset);
        }
 
+       /*
+        * If a platform says I/O port support is optional, we don't add
+        * the default I/O space.  The platform is responsible for adding
+        * any I/O space it needs.
+        */
+       if (io_optional)
+               return 0;
+
        resource_list_for_each_entry(window, &sys->resources)
                if (resource_type(window->res) == IORESOURCE_IO)
                        return 0;
@@ -466,7 +475,7 @@ static void pcibios_init_hw(struct device *parent, struct hw_pci *hw,
                if (ret > 0) {
                        struct pci_host_bridge *host_bridge;
 
-                       ret = pcibios_init_resources(nr, sys);
+                       ret = pcibios_init_resource(nr, sys, hw->io_optional);
                        if (ret)  {
                                kfree(sys);
                                break;