diff --git a/stand/kshim/bsd_kernel.h b/stand/kshim/bsd_kernel.h --- a/stand/kshim/bsd_kernel.h +++ b/stand/kshim/bsd_kernel.h @@ -650,6 +650,7 @@ 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 *); diff --git a/stand/kshim/bsd_kernel.c b/stand/kshim/bsd_kernel.c --- a/stand/kshim/bsd_kernel.c +++ b/stand/kshim/bsd_kernel.c @@ -664,7 +664,7 @@ } int -bus_generic_detach(device_t dev) +bus_detach_children(device_t dev) { device_t child; int error; @@ -679,6 +679,17 @@ 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) {