Module Name: src Committed By: riastradh Date: Sat Jul 23 08:45:03 UTC 2022
Modified Files: src/sys/external/bsd/drm2/pci: drm_pci_busid.c Log Message: drm: Go back to using device_unit(pciN) for pci busid. This isn't arbitrary; it has to match existing logic in userland in libpciaccess, and until we extend the pci(4) ioctl interface, and find some way to handle userland compatibility, we can't change it. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/pci/drm_pci_busid.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/pci/drm_pci_busid.c diff -u src/sys/external/bsd/drm2/pci/drm_pci_busid.c:1.2 src/sys/external/bsd/drm2/pci/drm_pci_busid.c:1.3 --- src/sys/external/bsd/drm2/pci/drm_pci_busid.c:1.2 Wed Jul 20 01:20:20 2022 +++ src/sys/external/bsd/drm2/pci/drm_pci_busid.c Sat Jul 23 08:45:03 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: drm_pci_busid.c,v 1.2 2022/07/20 01:20:20 riastradh Exp $ */ +/* $NetBSD: drm_pci_busid.c,v 1.3 2022/07/23 08:45:03 riastradh Exp $ */ /*- * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: drm_pci_busid.c,v 1.2 2022/07/20 01:20:20 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: drm_pci_busid.c,v 1.3 2022/07/23 08:45:03 riastradh Exp $"); #include <sys/types.h> #include <sys/device.h> @@ -52,7 +52,7 @@ drm_pci_set_busid(struct drm_device *dev KASSERT(dev_is_pci(dev->dev)); master->unique = kasprintf(GFP_KERNEL, "pci:%04x:%02x:%02x.%d", - pci_domain_nr(dev->pdev->bus), + device_unit(device_parent(dev->dev)), pa->pa_bus, pa->pa_device, pa->pa_function); if (master->unique == NULL) return -ENOMEM;