diff options
author | Damien Bergamini <damien@cvs.openbsd.org> | 2010-10-30 11:46:48 +0000 |
---|---|---|
committer | Damien Bergamini <damien@cvs.openbsd.org> | 2010-10-30 11:46:48 +0000 |
commit | 219c3281bfa12bbde54d95ea960dcf831104817d (patch) | |
tree | cf6ec0d82bb42a4b0e2a26b229ff0fd797ddfa7f | |
parent | e77eeed6e12c3a43d6ccfb30e8e1eb6e66d2222f (diff) |
use (ifp->if_softc != NULL) instead of (ifp->if_flags != 0) to check
if interface was attached.
both are correct but this is for consistency with other drivers.
-rw-r--r-- | sys/dev/usb/if_otus.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/if_run.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/usb/if_otus.c b/sys/dev/usb/if_otus.c index 8241187bda4..ad76cb23ad5 100644 --- a/sys/dev/usb/if_otus.c +++ b/sys/dev/usb/if_otus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_otus.c,v 1.20 2010/10/23 16:14:07 jakemsr Exp $ */ +/* $OpenBSD: if_otus.c,v 1.21 2010/10/30 11:46:47 damien Exp $ */ /*- * Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr> @@ -255,7 +255,7 @@ otus_detach(struct device *self, int flags) if (timeout_initialized(&sc->calib_to)) timeout_del(&sc->calib_to); - if (ifp->if_flags != 0) { /* if_attach() has been called. */ + if (ifp->if_softc != NULL) { ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); ieee80211_ifdetach(ifp); if_detach(ifp); diff --git a/sys/dev/usb/if_run.c b/sys/dev/usb/if_run.c index 44fb7abceec..454fce8e919 100644 --- a/sys/dev/usb/if_run.c +++ b/sys/dev/usb/if_run.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_run.c,v 1.75 2010/10/30 11:44:18 damien Exp $ */ +/* $OpenBSD: if_run.c,v 1.76 2010/10/30 11:46:47 damien Exp $ */ /*- * Copyright (c) 2008-2010 Damien Bergamini <damien.bergamini@free.fr> @@ -600,7 +600,7 @@ run_detach(struct device *self, int flags) if (timeout_initialized(&sc->calib_to)) timeout_del(&sc->calib_to); - if (ifp->if_flags != 0) { /* if_attach() has been called */ + if (ifp->if_softc != NULL) { ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); ieee80211_ifdetach(ifp); if_detach(ifp); |