stand/kshim: Implement bus_detach_children

While here, update bus_generic_detach to delete devices as in the
kernel.

Reviewed by:	imp, markj
Differential Revision:	https://reviews.freebsd.org/D48410
This commit is contained in:
John Baldwin
2025-01-10 23:02:27 -05:00
parent ee15875c01
commit 8e4535ee58
2 changed files with 13 additions and 1 deletions
+12 -1
View File
@@ -664,7 +664,7 @@ device_get_unit(device_t dev)
}
int
bus_generic_detach(device_t dev)
bus_detach_children(device_t dev)
{
device_t child;
int error;
@@ -679,6 +679,17 @@ bus_generic_detach(device_t dev)
return (0);
}
int
bus_generic_detach(device_t dev)
{
int error;
error = bus_detach_children(dev);
if (error == 0)
error = device_delete_children(dev);
return (error);
}
const char *
device_get_nameunit(device_t dev)
{
+1
View File
@@ -650,6 +650,7 @@ void bus_release_resources(device_t, const struct resource_spec *,
struct resource **);
struct resource *bus_alloc_resource_any(device_t, int, int *, unsigned int);
void bus_attach_children(device_t);
int bus_detach_children(device_t);
bus_space_tag_t rman_get_bustag(struct resource *);
bus_space_handle_t rman_get_bushandle(struct resource *);
u_long rman_get_size(struct resource *);