aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2022-04-21 17:29:14 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2022-04-21 17:29:14 +0000
commit489e8f24a57f76439fce5021d4945328fc868ad2 (patch)
treeb87827de1d3d93d2f8306c012a17c2afa26a53f2
parent82496a256fd4fe5b0e8dbd2d704e222752ae5edd (diff)
downloadsrc-489e8f24a57f76439fce5021d4945328fc868ad2.tar.gz
src-489e8f24a57f76439fce5021d4945328fc868ad2.zip
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
-rw-r--r--sys/dev/smbios/smbios.c7
-rw-r--r--sys/x86/bios/vpd.c7
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]);
}