dwmmc: Use device_delete_children

Instead of first detaching the children(s) and then delete them,
use the device_delete_children function that does all of that.

MFC after:	1 month
Suggested by:	ian
This commit is contained in:
Emmanuel Vadot 2019-12-11 19:40:30 +00:00
parent 0d80770c71
commit 5757a34c7a

View File

@ -752,7 +752,7 @@ dwmmc_detach(device_t dev)
sc = device_get_softc(dev);
ret = bus_generic_detach(dev);
ret = device_delete_children(dev);
if (ret != 0)
return (ret);
@ -766,12 +766,6 @@ dwmmc_detach(device_t dev)
}
bus_release_resources(dev, dwmmc_spec, sc->res);
if (sc->child) {
ret = device_delete_child(dev, sc->child);
if (ret != 0)
return (ret);
}
DWMMC_LOCK_DESTROY(sc);
#ifdef EXT_RESOURCES