summaryrefslogtreecommitdiff
path: root/sys/dev/mvs
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2011-11-19 10:11:50 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2011-11-19 10:11:50 +0000
commit11bcf702f4200a351f06b549e14bc9ea4fc76dcc (patch)
treed8ce224aa83a7409b55f7416386eadc3d984598d /sys/dev/mvs
parent76a869385c0c898a5815f16e4cc99ffc77d1f637 (diff)
Notes
Diffstat (limited to 'sys/dev/mvs')
-rw-r--r--sys/dev/mvs/mvs_pci.c9
-rw-r--r--sys/dev/mvs/mvs_soc.c9
2 files changed, 4 insertions, 14 deletions
diff --git a/sys/dev/mvs/mvs_pci.c b/sys/dev/mvs/mvs_pci.c
index e2e37daf5958..36dd93de2d5b 100644
--- a/sys/dev/mvs/mvs_pci.c
+++ b/sys/dev/mvs/mvs_pci.c
@@ -177,15 +177,10 @@ static int
mvs_detach(device_t dev)
{
struct mvs_controller *ctlr = device_get_softc(dev);
- device_t *children;
- int nchildren, i;
/* Detach & delete all children */
- if (!device_get_children(dev, &children, &nchildren)) {
- for (i = 0; i < nchildren; i++)
- device_delete_child(dev, children[i]);
- free(children, M_TEMP);
- }
+ device_delete_all_children(dev);
+
/* Free interrupt. */
if (ctlr->irq.r_irq) {
bus_teardown_intr(dev, ctlr->irq.r_irq,
diff --git a/sys/dev/mvs/mvs_soc.c b/sys/dev/mvs/mvs_soc.c
index 5c1116c5e6f5..670bfece3f97 100644
--- a/sys/dev/mvs/mvs_soc.c
+++ b/sys/dev/mvs/mvs_soc.c
@@ -173,15 +173,10 @@ static int
mvs_detach(device_t dev)
{
struct mvs_controller *ctlr = device_get_softc(dev);
- device_t *children;
- int nchildren, i;
/* Detach & delete all children */
- if (!device_get_children(dev, &children, &nchildren)) {
- for (i = 0; i < nchildren; i++)
- device_delete_child(dev, children[i]);
- free(children, M_TEMP);
- }
+ device_delete_all_children(dev);
+
/* Free interrupt. */
if (ctlr->irq.r_irq) {
bus_teardown_intr(dev, ctlr->irq.r_irq,