Merge branches 'pci/host-exynos', 'pci/host-iproc', 'pci/host-keystone', 'pci/host...
[platform/kernel/linux-rpi.git] / drivers / pci / pci.c
index 81f06e8..061fdce 100644 (file)
@@ -126,15 +126,16 @@ EXPORT_SYMBOL_GPL(pci_bus_max_busnr);
 #ifdef CONFIG_HAS_IOMEM
 void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar)
 {
+       struct resource *res = &pdev->resource[bar];
+
        /*
         * Make sure the BAR is actually a memory resource, not an IO resource
         */
-       if (!(pci_resource_flags(pdev, bar) & IORESOURCE_MEM)) {
-               WARN_ON(1);
+       if (res->flags & IORESOURCE_UNSET || !(res->flags & IORESOURCE_MEM)) {
+               dev_warn(&pdev->dev, "can't ioremap BAR %d: %pR\n", bar, res);
                return NULL;
        }
-       return ioremap_nocache(pci_resource_start(pdev, bar),
-                                    pci_resource_len(pdev, bar));
+       return ioremap_nocache(res->start, resource_size(res));
 }
 EXPORT_SYMBOL_GPL(pci_ioremap_bar);
 #endif
@@ -2492,6 +2493,7 @@ u8 pci_common_swizzle(struct pci_dev *dev, u8 *pinp)
        *pinp = pin;
        return PCI_SLOT(dev->devfn);
 }
+EXPORT_SYMBOL_GPL(pci_common_swizzle);
 
 /**
  *     pci_release_region - Release a PCI bar