summaryrefslogtreecommitdiff
path: root/sys/dev/usb
diff options
context:
space:
mode:
authorKevin Lo <kevlo@cvs.openbsd.org>2019-07-07 06:40:11 +0000
committerKevin Lo <kevlo@cvs.openbsd.org>2019-07-07 06:40:11 +0000
commit7e69d21826092f3d2acc68315bbff2baa9a9425e (patch)
tree8f05fdf5a76f186804cd9d4eef7bbde0547c51fa /sys/dev/usb
parente412b09d78f8e89cc84c2b3e7f0dd3b5f5edacfe (diff)
Eliminate duplicate code in xxx_detach().
ok mpi@
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/if_axe.c6
-rw-r--r--sys/dev/usb/if_axen.c6
-rw-r--r--sys/dev/usb/if_mos.c6
-rw-r--r--sys/dev/usb/if_mue.c6
-rw-r--r--sys/dev/usb/if_smsc.c6
5 files changed, 5 insertions, 25 deletions
diff --git a/sys/dev/usb/if_axe.c b/sys/dev/usb/if_axe.c
index 8d197a19b2b..01ac9e9a763 100644
--- a/sys/dev/usb/if_axe.c
+++ b/sys/dev/usb/if_axe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_axe.c,v 1.138 2017/01/22 10:17:39 dlg Exp $ */
+/* $OpenBSD: if_axe.c,v 1.139 2019/07/07 06:40:10 kevlo Exp $ */
/*
* Copyright (c) 2005, 2006, 2007 Jonathan Gray <jsg@openbsd.org>
@@ -881,10 +881,6 @@ axe_detach(struct device *self, int flags)
sc->axe_dev.dv_xname);
#endif
- if (--sc->axe_refcnt >= 0) {
- /* Wait for processes to go away. */
- usb_detach_wait(&sc->axe_dev);
- }
splx(s);
return (0);
diff --git a/sys/dev/usb/if_axen.c b/sys/dev/usb/if_axen.c
index 190bf2ecbc5..0b9d4a23330 100644
--- a/sys/dev/usb/if_axen.c
+++ b/sys/dev/usb/if_axen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_axen.c,v 1.26 2018/12/05 15:54:58 mpi Exp $ */
+/* $OpenBSD: if_axen.c,v 1.27 2019/07/07 06:40:10 kevlo Exp $ */
/*
* Copyright (c) 2013 Yojiro UO <yuo@openbsd.org>
@@ -778,10 +778,6 @@ axen_detach(struct device *self, int flags)
sc->axen_dev.dv_xname);
#endif
- if (--sc->axen_refcnt >= 0) {
- /* Wait for processes to go away. */
- usb_detach_wait(&sc->axen_dev);
- }
splx(s);
return 0;
diff --git a/sys/dev/usb/if_mos.c b/sys/dev/usb/if_mos.c
index 4b7d6324f42..62fd7e47323 100644
--- a/sys/dev/usb/if_mos.c
+++ b/sys/dev/usb/if_mos.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_mos.c,v 1.39 2018/07/03 00:47:49 kevlo Exp $ */
+/* $OpenBSD: if_mos.c,v 1.40 2019/07/07 06:40:10 kevlo Exp $ */
/*
* Copyright (c) 2008 Johann Christian Rode <jcrode@gmx.net>
@@ -784,10 +784,6 @@ mos_detach(struct device *self, int flags)
sc->mos_dev.dv_xname);
#endif
- if (--sc->mos_refcnt >= 0) {
- /* Wait for processes to go away. */
- usb_detach_wait(&sc->mos_dev);
- }
splx(s);
return (0);
diff --git a/sys/dev/usb/if_mue.c b/sys/dev/usb/if_mue.c
index 75e6efa2d91..e6d7bf71f99 100644
--- a/sys/dev/usb/if_mue.c
+++ b/sys/dev/usb/if_mue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_mue.c,v 1.6 2019/07/06 13:37:09 kevlo Exp $ */
+/* $OpenBSD: if_mue.c,v 1.7 2019/07/07 06:40:10 kevlo Exp $ */
/*
* Copyright (c) 2018 Kevin Lo <kevlo@openbsd.org>
@@ -855,10 +855,6 @@ mue_detach(struct device *self, int flags)
if_detach(ifp);
}
- if (--sc->mue_refcnt >= 0) {
- /* Wait for processes to go away. */
- usb_detach_wait(&sc->mue_dev);
- }
splx(s);
return (0);
diff --git a/sys/dev/usb/if_smsc.c b/sys/dev/usb/if_smsc.c
index d1508b0f29d..07457f4c594 100644
--- a/sys/dev/usb/if_smsc.c
+++ b/sys/dev/usb/if_smsc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_smsc.c,v 1.32 2018/08/25 17:09:40 mestre Exp $ */
+/* $OpenBSD: if_smsc.c,v 1.33 2019/07/07 06:40:10 kevlo Exp $ */
/* $FreeBSD: src/sys/dev/usb/net/if_smsc.c,v 1.1 2012/08/15 04:03:55 gonzo Exp $ */
/*-
* Copyright (c) 2012
@@ -1118,10 +1118,6 @@ smsc_detach(struct device *self, int flags)
sc->sc_dev.dv_xname);
#endif
- if (--sc->sc_refcnt >= 0) {
- /* Wait for processes to go away. */
- usb_detach_wait(&sc->sc_dev);
- }
splx(s);
return (0);