summaryrefslogtreecommitdiffstats
path: root/sys/dev/ep/if_ep.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2005-09-20 19:50:27 +0000
committerimp <imp@FreeBSD.org>2005-09-20 19:50:27 +0000
commit70a9967120874240894e85033daa206e3a6d8df1 (patch)
tree9c7e33619d0f5acaada9464f067799079e5197f0 /sys/dev/ep/if_ep.c
parentc1ba22dc8d6f4a56c7a2f2ebfc6904ef6b413695 (diff)
downloadFreeBSD-src-70a9967120874240894e85033daa206e3a6d8df1.zip
FreeBSD-src-70a9967120874240894e85033daa206e3a6d8df1.tar.gz
Better use of gone.
Diffstat (limited to 'sys/dev/ep/if_ep.c')
-rw-r--r--sys/dev/ep/if_ep.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/sys/dev/ep/if_ep.c b/sys/dev/ep/if_ep.c
index 1cb8c81..0c6f65c 100644
--- a/sys/dev/ep/if_ep.c
+++ b/sys/dev/ep/if_ep.c
@@ -350,19 +350,17 @@ ep_detach(device_t dev)
struct ifnet *ifp;
sc = device_get_softc(dev);
- EP_ASSERT_UNLOCKED(sc);
ifp = sc->ifp;
-
- if (sc->gone)
- return (0);
+ EP_ASSERT_UNLOCKED(sc);
+ EP_LOCK(sc);
if (bus_child_present(dev))
epstop(sc);
-
+ sc->gone = 1;
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
+ EP_UNLOCK(sc);
ether_ifdetach(ifp);
-
- sc->gone = 1;
ep_free(dev);
+
if_free(ifp);
EP_LOCK_DESTROY(sc);
@@ -964,8 +962,6 @@ epwatchdog(struct ifnet *ifp)
static void
epstop(struct ep_softc *sc)
{
- if (sc->gone)
- return;
CSR_WRITE_2(sc, EP_COMMAND, RX_DISABLE);
CSR_WRITE_2(sc, EP_COMMAND, RX_DISCARD_TOP_PACK);
EP_BUSY_WAIT(sc);
OpenPOWER on IntegriCloud