Module Name:    src
Committed By:   jmcneill
Date:           Sat Jan 18 02:59:42 UTC 2020

Modified Files:
        src/sys/external/bsd/drm2/linux: linux_pci.c

Log Message:
Use pci_get_segment if available


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm2/linux/linux_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/linux/linux_pci.c
diff -u src/sys/external/bsd/drm2/linux/linux_pci.c:1.6 src/sys/external/bsd/drm2/linux/linux_pci.c:1.7
--- src/sys/external/bsd/drm2/linux/linux_pci.c:1.6	Tue Aug 28 03:41:39 2018
+++ src/sys/external/bsd/drm2/linux/linux_pci.c	Sat Jan 18 02:59:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_pci.c,v 1.6 2018/08/28 03:41:39 riastradh Exp $	*/
+/*	$NetBSD: linux_pci.c,v 1.7 2020/01/18 02:59:42 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -29,8 +29,12 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#ifdef _KERNEL_OPT
+#include "opt_pci.h"
+#endif
+
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_pci.c,v 1.6 2018/08/28 03:41:39 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_pci.c,v 1.7 2020/01/18 02:59:42 jmcneill Exp $");
 
 #include <linux/pci.h>
 
@@ -66,7 +70,12 @@ linux_pci_dev_init(struct pci_dev *pdev,
 	pdev->pd_rom_vaddr = NULL;
 	pdev->pd_dev = dev;
 #if (NACPICA > 0)
-	pdev->pd_ad = acpi_pcidev_find(0 /*XXX segment*/, pa->pa_bus,
+#ifdef __HAVE_PCI_GET_SEGMENT
+	const int seg = pci_get_segment(pa->pa_pc);
+#else
+	const int seg = 0;
+#endif
+	pdev->pd_ad = acpi_pcidev_find(seg, pa->pa_bus,
 	    pa->pa_device, pa->pa_function);
 #else
 	pdev->pd_ad = NULL;

Reply via email to