summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorScott Branden <scott.branden@broadcom.com>2018-04-17 10:52:25 -0700
committerThomas Monjalon <thomas@monjalon.net>2018-04-20 11:10:55 +0200
commit08efcf533f6a1dc5b12bcf1d5ded83743b8d5cc4 (patch)
tree995dd330be9ef25594549886a77b72775375456c /kernel
parente70e26861eaf735a296807a909d7c5c2a568a1c2 (diff)
downloaddpdk-08efcf533f6a1dc5b12bcf1d5ded83743b8d5cc4.zip
dpdk-08efcf533f6a1dc5b12bcf1d5ded83743b8d5cc4.tar.gz
dpdk-08efcf533f6a1dc5b12bcf1d5ded83743b8d5cc4.tar.xz
igb_uio: fix build on Linux < 3.16
Starting from Linux v3.16 pci_is_bridge() is in linux/pci.h, in previous versions it is in drivers/pci/pci.h which is private header. Fix build error when calling pci_is_bridge by not calling/supporting pci_is_bridge with kernel versions before 3.16. Fixes: 6f0841b7701b ("igb_uio: bind error if PCIe bridge") Reported-by: Ferruh Yigit <ferruh.yigit@intel.com> Signed-off-by: Scott Branden <scott.branden@broadcom.com> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com> Acked-by: Bernard Iremonger <bernard.iremonger@intel.com> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/linux/igb_uio/compat.h4
-rw-r--r--kernel/linux/igb_uio/igb_uio.c2
2 files changed, 6 insertions, 0 deletions
diff --git a/kernel/linux/igb_uio/compat.h b/kernel/linux/igb_uio/compat.h
index ce456d4..d9f4d29 100644
--- a/kernel/linux/igb_uio/compat.h
+++ b/kernel/linux/igb_uio/compat.h
@@ -121,6 +121,10 @@ static bool pci_check_and_mask_intx(struct pci_dev *pdev)
#endif /* < 3.3.0 */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)
+#define HAVE_PCI_IS_BRIDGE_API 1
+#endif
+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
#define HAVE_ALLOC_IRQ_VECTORS 1
#endif
diff --git a/kernel/linux/igb_uio/igb_uio.c b/kernel/linux/igb_uio/igb_uio.c
index cbc5ab6..cd9b7e7 100644
--- a/kernel/linux/igb_uio/igb_uio.c
+++ b/kernel/linux/igb_uio/igb_uio.c
@@ -473,10 +473,12 @@ igbuio_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
void *map_addr;
int err;
+#ifdef HAVE_PCI_IS_BRIDGE_API
if (pci_is_bridge(dev)) {
dev_warn(&dev->dev, "Ignoring PCI bridge device\n");
return -ENODEV;
}
+#endif
udev = kzalloc(sizeof(struct rte_uio_pci_dev), GFP_KERNEL);
if (!udev)