git: 81d058df6d25 - main - LinuxKPI: allow bsddriver name to be set for PCI

From: Bjoern A. Zeeb <>
Date: Thu, 24 Mar 2022 15:21:08 UTC
The branch main has been updated by bz:


commit 81d058df6d255b7f551564f6d29a03692b51fe5a
Author:     Bjoern A. Zeeb <>
AuthorDate: 2022-03-24 01:45:36 +0000
Commit:     Bjoern A. Zeeb <>
CommitDate: 2022-03-24 15:19:15 +0000

    LinuxKPI: allow bsddriver name to be set for PCI
    Allow a driver to overwrite the bsddriver name (we use for pci and
    for wlan parent devices).  This allows us to to set in struct pci_driver passed to module_pci_driver()
    and with that set the BSD driver name while retaining the Linux .name
    This is helpful for divers which have different parts depending on
    chipset and with that would change driver names which is highly
    confusing especially for configuration.   One example is an upcoming
    rtw88 driver which would be rtw_8822be or rtw_8822ce depending on
    Sponsored by:   The FreeBSD Foundation
    MFC after:      3 days
    Reviewed by:    emaste, hselasky
    Differential Revision:
 sys/compat/linuxkpi/common/src/linux_pci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c
index b4f4a2219bb4..f8ae03d2bf28 100644
--- a/sys/compat/linuxkpi/common/src/linux_pci.c
+++ b/sys/compat/linuxkpi/common/src/linux_pci.c
@@ -654,7 +654,8 @@ _linux_pci_register_driver(struct pci_driver *pdrv, devclass_t dc)
 	list_add(&pdrv->node, &pci_drivers);
-	pdrv-> = pdrv->name;
+	if (pdrv-> == NULL)
+		pdrv-> = pdrv->name;
 	pdrv->bsddriver.methods = pci_methods;
 	pdrv->bsddriver.size = sizeof(struct pci_dev);