From cc304302b91aadc1a76e5aa37fddbe4fb79ef676 Mon Sep 17 00:00:00 2001 From: Arjan van de Ven Date: Sun, 28 Sep 2008 16:36:11 -0700 Subject: [PATCH] --- yaml --- r: 116728 b: refs/heads/master c: aa42d7c6138afdc54f74e971456a0fbfec16b77b h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/linux/pci.h | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) 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 */