diff options
author | Hans Petter Selasky <hselasky@FreeBSD.org> | 2011-11-19 10:11:50 +0000 |
---|---|---|
committer | Hans Petter Selasky <hselasky@FreeBSD.org> | 2011-11-19 10:11:50 +0000 |
commit | 11bcf702f4200a351f06b549e14bc9ea4fc76dcc (patch) | |
tree | d8ce224aa83a7409b55f7416386eadc3d984598d /sys/dev/ata/ata-disk.c | |
parent | 76a869385c0c898a5815f16e4cc99ffc77d1f637 (diff) | |
download | src-11bcf702f4200a351f06b549e14bc9ea4fc76dcc.tar.gz src-11bcf702f4200a351f06b549e14bc9ea4fc76dcc.zip |
Move the device_delete_all_children() function from usb_util.c
to kern/subr_bus.c. Simplify this function so that it no longer
depends on malloc() to execute. Identify a few other places where
it makes sense to use device_delete_all_children().
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=227701
Diffstat (limited to 'sys/dev/ata/ata-disk.c')
-rw-r--r-- | sys/dev/ata/ata-disk.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/sys/dev/ata/ata-disk.c b/sys/dev/ata/ata-disk.c index bcaf6c4fee89..c872f62da955 100644 --- a/sys/dev/ata/ata-disk.c +++ b/sys/dev/ata/ata-disk.c @@ -172,8 +172,6 @@ ad_detach(device_t dev) { struct ad_softc *adp = device_get_ivars(dev); struct ata_device *atadev = device_get_softc(dev); - device_t *children; - int nchildren, i; /* check that we have a valid disk to detach */ if (!device_get_ivars(dev)) @@ -183,12 +181,7 @@ ad_detach(device_t dev) callout_drain(&atadev->spindown_timer); /* detach & delete all children */ - if (!device_get_children(dev, &children, &nchildren)) { - for (i = 0; i < nchildren; i++) - if (children[i]) - device_delete_child(dev, children[i]); - free(children, M_TEMP); - } + device_delete_all_children(dev); /* destroy disk from the system so we don't get any further requests */ disk_destroy(adp->disk); |