Date: Sat, 18 May 2019 13:27:09 +0000 (UTC) From: Johannes Lundberg <johalun@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347954 - in stable/12/sys/compat/linuxkpi/common: include/linux src Message-ID: <201905181327.x4IDR9EK005864@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: johalun Date: Sat May 18 13:27:09 2019 New Revision: 347954 URL: https://svnweb.freebsd.org/changeset/base/347954 Log: MFC ------------------------------------------------------------------------ r347470 | johalun | 2019-05-10 16:10:22 -0700 (Fri, 10 May 2019) | 9 lines Implement linux_pci_unregister_drm_driver in linuxkpi so that drm drivers can be unloaded. This patch is a part of D19565. Reviewed by: hps Approved by: imp (mentor), hps MFC after: 1 week ------------------------------------------------------------------------ Modified: stable/12/sys/compat/linuxkpi/common/include/linux/pci.h stable/12/sys/compat/linuxkpi/common/src/linux_pci.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/pci.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/pci.h Sat May 18 12:27:22 2019 (r347953) +++ stable/12/sys/compat/linuxkpi/common/include/linux/pci.h Sat May 18 13:27:09 2019 (r347954) @@ -521,6 +521,7 @@ pci_write_config_dword(struct pci_dev *pdev, int where int linux_pci_register_driver(struct pci_driver *pdrv); int linux_pci_register_drm_driver(struct pci_driver *pdrv); void linux_pci_unregister_driver(struct pci_driver *pdrv); +void linux_pci_unregister_drm_driver(struct pci_driver *pdrv); #define pci_register_driver(pdrv) linux_pci_register_driver(pdrv) #define pci_unregister_driver(pdrv) linux_pci_unregister_driver(pdrv) Modified: stable/12/sys/compat/linuxkpi/common/src/linux_pci.c ============================================================================== --- stable/12/sys/compat/linuxkpi/common/src/linux_pci.c Sat May 18 12:27:22 2019 (r347953) +++ stable/12/sys/compat/linuxkpi/common/src/linux_pci.c Sat May 18 13:27:09 2019 (r347954) @@ -330,3 +330,19 @@ linux_pci_unregister_driver(struct pci_driver *pdrv) devclass_delete_driver(bus, &pdrv->bsddriver); mtx_unlock(&Giant); } + +void +linux_pci_unregister_drm_driver(struct pci_driver *pdrv) +{ + devclass_t bus; + + bus = devclass_find("vgapci"); + + spin_lock(&pci_lock); + list_del(&pdrv->links); + spin_unlock(&pci_lock); + mtx_lock(&Giant); + if (bus != NULL) + devclass_delete_driver(bus, &pdrv->bsddriver); + mtx_unlock(&Giant); +}
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905181327.x4IDR9EK005864>