diff --git a/[refs] b/[refs] index c38d238696fd..60b40fc5afd5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e9f82cb75096ae30658a72d473bf170bf4d3bb2e +refs/heads/master: aa42d7c6138afdc54f74e971456a0fbfec16b77b diff --git a/trunk/include/linux/pci.h b/trunk/include/linux/pci.h index 7e9a1f0715e6..46ad282ffe4d 100644 --- a/trunk/include/linux/pci.h +++ b/trunk/include/linux/pci.h @@ -1119,5 +1119,18 @@ static inline void pci_mmcfg_early_init(void) { } static inline void pci_mmcfg_late_init(void) { } #endif +static inline void * pci_ioremap_bar(struct pci_dev *pdev, int 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); + return NULL; + } + return ioremap_nocache(pci_resource_start(pdev, bar), + pci_resource_len(pdev, bar)); +} + #endif /* __KERNEL__ */ #endif /* LINUX_PCI_H */