diff options
| author | Vladimir Kondratyev <wulf@FreeBSD.org> | 2024-07-21 13:02:08 +0000 |
|---|---|---|
| committer | Vladimir Kondratyev <wulf@FreeBSD.org> | 2024-08-01 22:31:06 +0000 |
| commit | 85da0abada244f90dc6e9ce36c75492f0aa9bf02 (patch) | |
| tree | 5df29c8c22d24df9242495f1b1bcff499ed37576 | |
| parent | 8f31e64ca336e90b7fdfee4d185773f677341626 (diff) | |
LinuxKPI: Automatically enable drm support for devices named "drmn"
This allows replace linux_pci_(un)register_drm_driver calls with driver
renaming to FreeBSD name.
Sponsored by: Serenity CyberSecurity, LLC
MFC after: 1 week
Reviewed by: manu, bz
Differential Revision: https://reviews.freebsd.org/D45906
(cherry picked from commit 5d20075f8b9f7107aa0a246e5165d9816e816a44)
| -rw-r--r-- | sys/compat/linuxkpi/common/src/linux_pci.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index 5f7296d66ee9..459f03f7e2a4 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -752,7 +752,8 @@ linux_pci_register_driver(struct pci_driver *pdrv) { devclass_t dc; - dc = devclass_find("pci"); + pdrv->isdrm = strcmp(pdrv->name, "drmn") == 0; + dc = pdrv->isdrm ? devclass_create("vgapci") : devclass_find("pci"); if (dc == NULL) return (-ENXIO); return (_linux_pci_register_driver(pdrv, dc)); @@ -907,7 +908,7 @@ linux_pci_unregister_driver(struct pci_driver *pdrv) { devclass_t bus; - bus = devclass_find("pci"); + bus = devclass_find(pdrv->isdrm ? "vgapci" : "pci"); spin_lock(&pci_lock); list_del(&pdrv->node); |
