summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordamien <damien@openbsd.org>2010-10-30 11:46:47 +0000
committerdamien <damien@openbsd.org>2010-10-30 11:46:47 +0000
commit9f3a1e51b8a9b6700d5f1e3b99c0aa808afb0900 (patch)
tree1e90cb2c8477a14af9c66c7262eec75016dd4533
parentuse hw sequence numbering for non-QoS frames (diff)
downloadwireguard-openbsd-9f3a1e51b8a9b6700d5f1e3b99c0aa808afb0900.tar.xz
wireguard-openbsd-9f3a1e51b8a9b6700d5f1e3b99c0aa808afb0900.zip
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.c4
-rw-r--r--sys/dev/usb/if_run.c4
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);