Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/bsd/drm2/linux Use pci_get_segment if available
details: https://anonhg.NetBSD.org/src/rev/3167421c9d34
branches: trunk
changeset: 848112:3167421c9d34
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Sat Jan 18 02:59:42 2020 +0000
description:
Use pci_get_segment if available
diffstat:
sys/external/bsd/drm2/linux/linux_pci.c | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diffs (37 lines):
diff -r 93957f756b9c -r 3167421c9d34 sys/external/bsd/drm2/linux/linux_pci.c
--- a/sys/external/bsd/drm2/linux/linux_pci.c Sat Jan 18 02:42:23 2020 +0000
+++ b/sys/external/bsd/drm2/linux/linux_pci.c Sat Jan 18 02:59:42 2020 +0000
@@ -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 @@
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;
Home |
Main Index |
Thread Index |
Old Index