git: 489e8f24a57f - main - smbios/vpd: Use devclass_find to lookup devclass in module event handler.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 21 Apr 2022 17:30:06 UTC
The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=489e8f24a57f76439fce5021d4945328fc868ad2 commit 489e8f24a57f76439fce5021d4945328fc868ad2 Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2022-04-21 17:29:14 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2022-04-21 17:29:14 +0000 smbios/vpd: Use devclass_find to lookup devclass in module event handler. While here, use a modern function declaration for smbios_modevent and vpd_modevent. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D34996 --- sys/dev/smbios/smbios.c | 7 ++----- sys/x86/bios/vpd.c | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/sys/dev/smbios/smbios.c b/sys/dev/smbios/smbios.c index f3519634e1a4..1e6dd2a20166 100644 --- a/sys/dev/smbios/smbios.c +++ b/sys/dev/smbios/smbios.c @@ -209,10 +209,7 @@ smbios_detach (device_t dev) } static int -smbios_modevent (mod, what, arg) - module_t mod; - int what; - void * arg; +smbios_modevent (module_t mod, int what, void *arg) { device_t * devs; int count; @@ -222,7 +219,7 @@ smbios_modevent (mod, what, arg) case MOD_LOAD: break; case MOD_UNLOAD: - devclass_get_devices(smbios_devclass, &devs, &count); + devclass_get_devices(devclass_find("smbios"), &devs, &count); for (i = 0; i < count; i++) { device_delete_child(device_get_parent(devs[i]), devs[i]); } diff --git a/sys/x86/bios/vpd.c b/sys/x86/bios/vpd.c index 195c6a57f094..c47e2d1fe216 100644 --- a/sys/x86/bios/vpd.c +++ b/sys/x86/bios/vpd.c @@ -252,10 +252,7 @@ vpd_detach (device_t dev) } static int -vpd_modevent (mod, what, arg) - module_t mod; - int what; - void * arg; +vpd_modevent (module_t mod, int what, void *arg) { device_t * devs; int count; @@ -265,7 +262,7 @@ vpd_modevent (mod, what, arg) case MOD_LOAD: break; case MOD_UNLOAD: - devclass_get_devices(vpd_devclass, &devs, &count); + devclass_get_devices(devclass_find("vpd"), &devs, &count); for (i = 0; i < count; i++) { device_delete_child(device_get_parent(devs[i]), devs[i]); }