aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMaxime Henrion <mux@FreeBSD.org>2003-04-11 12:52:52 +0000
committerMaxime Henrion <mux@FreeBSD.org>2003-04-11 12:52:52 +0000
commit20f0c80f6feb5e1ab73e06f9565732b34180dbad (patch)
tree567a70c815abcba3c2be5402cf98357100f4993f /sys/dev
parenta4c9ca4f83a35cda2c014f3e1cbf71c5e2b0ad1a (diff)
Notes
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/fxp/if_fxp.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/sys/dev/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c
index 2612fd86ca788..bf9d18fdb1462 100644
--- a/sys/dev/fxp/if_fxp.c
+++ b/sys/dev/fxp/if_fxp.c
@@ -869,34 +869,32 @@ fxp_detach(device_t dev)
struct fxp_softc *sc = device_get_softc(dev);
int s;
- /* disable interrupts */
- CSR_WRITE_1(sc, FXP_CSR_SCB_INTRCNTL, FXP_SCB_INTR_DISABLE);
-
s = splimp();
+ /*
+ * Close down routes etc.
+ */
+ ether_ifdetach(&sc->arpcom.ac_if);
- if (device_is_alive(dev)) {
- /*
- * Stop DMA and drop transmit queue.
- */
- if (bus_child_present(dev))
- fxp_stop(sc);
- /*
- * Close down routes etc.
- */
- ether_ifdetach(&sc->arpcom.ac_if);
- device_delete_child(dev, sc->miibus);
- bus_generic_detach(dev);
- /*
- * Free all media structures.
- */
- ifmedia_removeall(&sc->sc_media);
+ /*
+ * Stop DMA and drop transmit queue.
+ */
+ if (bus_child_present(dev)) {
+ /* disable interrupts */
+ CSR_WRITE_1(sc, FXP_CSR_SCB_INTRCNTL, FXP_SCB_INTR_DISABLE);
+ fxp_stop(sc);
}
+ device_delete_child(dev, sc->miibus);
+ bus_generic_detach(dev);
+ /*
+ * Free all media structures.
+ */
+ ifmedia_removeall(&sc->sc_media);
+
splx(s);
/* Release our allocated resources. */
fxp_release(sc);
-
return (0);
}