summaryrefslogtreecommitdiff
path: root/sys/dev/amr/amr_pci.c
diff options
context:
space:
mode:
authorEric Moore <emoore@FreeBSD.org>2002-12-11 20:59:46 +0000
committerEric Moore <emoore@FreeBSD.org>2002-12-11 20:59:46 +0000
commitd6b32def6c61c428076df93608fb866e10078dcc (patch)
tree426e232feefcc8a33a07b7c836ee1b8494879e60 /sys/dev/amr/amr_pci.c
parenta5297d2a512c5cb1c1b689c3792036e843c7a143 (diff)
Notes
Diffstat (limited to 'sys/dev/amr/amr_pci.c')
-rw-r--r--sys/dev/amr/amr_pci.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/sys/dev/amr/amr_pci.c b/sys/dev/amr/amr_pci.c
index 7fcc6d4c2e0b..f870d4cbbc5c 100644
--- a/sys/dev/amr/amr_pci.c
+++ b/sys/dev/amr/amr_pci.c
@@ -337,6 +337,7 @@ static int
amr_pci_shutdown(device_t dev)
{
struct amr_softc *sc = device_get_softc(dev);
+ int i,error,s;
debug_called(1);
@@ -348,9 +349,23 @@ amr_pci_shutdown(device_t dev)
device_printf(sc->amr_dev, "flushing cache...");
printf("%s\n", amr_flush(sc) ? "failed" : "done");
+ s = splbio();
+ error = 0;
+
+ /* delete all our child devices */
+ for(i = 0 ; i < AMR_MAXLD; i++) {
+ if( sc->amr_drive[i].al_disk != 0) {
+ if((error = device_delete_child(sc->amr_dev,sc->amr_drive[i].al_disk)) != 0)
+ goto shutdown_out;
+ sc->amr_drive[i].al_disk = 0;
+ }
+ }
+
/* XXX disable interrupts? */
-
- return(0);
+
+shutdown_out:
+ splx(s);
+ return(error);
}
/********************************************************************************