mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-22 03:04:34 +01:00
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
This commit is contained in:
parent
619c9488a3
commit
5d20075f8b
@ -976,10 +976,10 @@ 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);
|
||||
pdrv->isdrm = false;
|
||||
return (_linux_pci_register_driver(pdrv, dc));
|
||||
}
|
||||
|
||||
@ -1166,7 +1166,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);
|
||||
|
Loading…
Reference in New Issue
Block a user