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/pci drm: Go back to using device_unit(...



details:   https://anonhg.NetBSD.org/src/rev/a8bbfbb7f0f6
branches:  trunk
changeset: 368638:a8bbfbb7f0f6
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat Jul 23 08:45:03 2022 +0000

description:
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.

diffstat:

 sys/external/bsd/drm2/pci/drm_pci_busid.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r b24d6fdf4fd7 -r a8bbfbb7f0f6 sys/external/bsd/drm2/pci/drm_pci_busid.c
--- a/sys/external/bsd/drm2/pci/drm_pci_busid.c Sat Jul 23 03:08:17 2022 +0000
+++ b/sys/external/bsd/drm2/pci/drm_pci_busid.c Sat Jul 23 08:45:03 2022 +0000
@@ -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 @@
        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;



Home | Main Index | Thread Index | Old Index