diff options
-rw-r--r-- | drivers/pci/pci.c | 16 | ||||
-rw-r--r-- | include/linux/pci.h | 15 |
2 files changed, 17 insertions, 14 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 1fb7cff4cdae..9354dd63f035 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -56,6 +56,22 @@ unsigned char pci_bus_max_busnr(struct pci_bus* bus) | |||
56 | } | 56 | } |
57 | EXPORT_SYMBOL_GPL(pci_bus_max_busnr); | 57 | EXPORT_SYMBOL_GPL(pci_bus_max_busnr); |
58 | 58 | ||
59 | #ifdef CONFIG_HAS_IOMEM | ||
60 | void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar) | ||
61 | { | ||
62 | /* | ||
63 | * Make sure the BAR is actually a memory resource, not an IO resource | ||
64 | */ | ||
65 | if (!(pci_resource_flags(pdev, bar) & IORESOURCE_MEM)) { | ||
66 | WARN_ON(1); | ||
67 | return NULL; | ||
68 | } | ||
69 | return ioremap_nocache(pci_resource_start(pdev, bar), | ||
70 | pci_resource_len(pdev, bar)); | ||
71 | } | ||
72 | EXPORT_SYMBOL_GPL(pci_ioremap_bar); | ||
73 | #endif | ||
74 | |||
59 | #if 0 | 75 | #if 0 |
60 | /** | 76 | /** |
61 | * pci_max_busnr - returns maximum PCI bus number | 77 | * pci_max_busnr - returns maximum PCI bus number |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 58357d14f94c..0d8bc920c2e5 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -1160,20 +1160,7 @@ static inline void pci_mmcfg_late_init(void) { } | |||
1160 | 1160 | ||
1161 | int pci_ext_cfg_avail(struct pci_dev *dev); | 1161 | int pci_ext_cfg_avail(struct pci_dev *dev); |
1162 | 1162 | ||
1163 | #ifdef CONFIG_HAS_IOMEM | 1163 | void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar); |
1164 | static inline void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar) | ||
1165 | { | ||
1166 | /* | ||
1167 | * Make sure the BAR is actually a memory resource, not an IO resource | ||
1168 | */ | ||
1169 | if (!(pci_resource_flags(pdev, bar) & IORESOURCE_MEM)) { | ||
1170 | WARN_ON(1); | ||
1171 | return NULL; | ||
1172 | } | ||
1173 | return ioremap_nocache(pci_resource_start(pdev, bar), | ||
1174 | pci_resource_len(pdev, bar)); | ||
1175 | } | ||
1176 | #endif | ||
1177 | 1164 | ||
1178 | #endif /* __KERNEL__ */ | 1165 | #endif /* __KERNEL__ */ |
1179 | #endif /* LINUX_PCI_H */ | 1166 | #endif /* LINUX_PCI_H */ |