diff options
| author | riastradh <riastradh@NetBSD.org> | 2022-03-03 05:55:01 +0000 |
|---|---|---|
| committer | riastradh <riastradh@NetBSD.org> | 2022-03-03 05:55:01 +0000 |
| commit | a5bc9be03ed762275ec00f70e1c942fa3395ae39 (patch) | |
| tree | 614aa5336f133dd9ccd5d8dbd3aa71e4429e3526 /sys/dev | |
| parent | 935c5078f86637fd83c4744283794c06378fd0da (diff) | |
usbnet drivers: Omit needless isdying tests in *_uno_init.
usbnet(9) already checks this immediately before calling *_uno_init.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/usb/if_aue.c | 7 | ||||
| -rw-r--r-- | sys/dev/usb/if_axe.c | 7 | ||||
| -rw-r--r-- | sys/dev/usb/if_axen.c | 7 | ||||
| -rw-r--r-- | sys/dev/usb/if_cdce.c | 14 | ||||
| -rw-r--r-- | sys/dev/usb/if_cue.c | 7 | ||||
| -rw-r--r-- | sys/dev/usb/if_kue.c | 7 | ||||
| -rw-r--r-- | sys/dev/usb/if_mos.c | 7 | ||||
| -rw-r--r-- | sys/dev/usb/if_mue.c | 9 | ||||
| -rw-r--r-- | sys/dev/usb/if_smsc.c | 7 | ||||
| -rw-r--r-- | sys/dev/usb/if_udav.c | 8 | ||||
| -rw-r--r-- | sys/dev/usb/if_upl.c | 9 | ||||
| -rw-r--r-- | sys/dev/usb/if_ure.c | 7 | ||||
| -rw-r--r-- | sys/dev/usb/if_url.c | 7 |
13 files changed, 30 insertions, 73 deletions
diff --git a/sys/dev/usb/if_aue.c b/sys/dev/usb/if_aue.c index 9b1287e7409..2c225020bec 100644 --- a/sys/dev/usb/if_aue.c +++ b/sys/dev/usb/if_aue.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_aue.c,v 1.186 2022/03/03 05:54:37 riastradh Exp $ */ +/* $NetBSD: if_aue.c,v 1.187 2022/03/03 05:55:01 riastradh Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -76,7 +76,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.186 2022/03/03 05:54:37 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.187 2022/03/03 05:55:01 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -954,9 +954,6 @@ aue_uno_init(struct ifnet *ifp) AUEHIST_CALLARGSN(5, "aue%jd: enter link=%jd", device_unit(un->un_dev), usbnet_havelink(un), 0, 0); - if (usbnet_isdying(un)) - return EIO; - /* Cancel pending I/O */ if (ifp->if_flags & IFF_RUNNING) return 0; diff --git a/sys/dev/usb/if_axe.c b/sys/dev/usb/if_axe.c index 9b1cc78d423..cf6bf508d6c 100644 --- a/sys/dev/usb/if_axe.c +++ b/sys/dev/usb/if_axe.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_axe.c,v 1.145 2022/03/03 05:54:37 riastradh Exp $ */ +/* $NetBSD: if_axe.c,v 1.146 2022/03/03 05:55:01 riastradh Exp $ */ /* $OpenBSD: if_axe.c,v 1.137 2016/04/13 11:03:37 mpi Exp $ */ /* @@ -87,7 +87,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.145 2022/03/03 05:54:37 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.146 2022/03/03 05:55:01 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -1211,9 +1211,6 @@ axe_uno_init(struct ifnet *ifp) struct axe_softc * const sc = usbnet_softc(un); int rxmode; - if (usbnet_isdying(un)) - return EIO; - /* Cancel pending I/O */ usbnet_stop(un, ifp, 1); diff --git a/sys/dev/usb/if_axen.c b/sys/dev/usb/if_axen.c index 1c956e4a32c..667aeeac39e 100644 --- a/sys/dev/usb/if_axen.c +++ b/sys/dev/usb/if_axen.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_axen.c,v 1.89 2022/03/03 05:54:37 riastradh Exp $ */ +/* $NetBSD: if_axen.c,v 1.90 2022/03/03 05:55:01 riastradh Exp $ */ /* $OpenBSD: if_axen.c,v 1.3 2013/10/21 10:10:22 yuo Exp $ */ /* @@ -23,7 +23,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.89 2022/03/03 05:54:37 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.90 2022/03/03 05:55:01 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -876,9 +876,6 @@ axen_uno_init(struct ifnet *ifp) uint16_t wval; uint8_t bval; - if (usbnet_isdying(un)) - return EIO; - /* Cancel pending I/O */ usbnet_stop(un, ifp, 1); diff --git a/sys/dev/usb/if_cdce.c b/sys/dev/usb/if_cdce.c index bc022698d19..7380e03919c 100644 --- a/sys/dev/usb/if_cdce.c +++ b/sys/dev/usb/if_cdce.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_cdce.c,v 1.74 2022/03/03 05:52:20 riastradh Exp $ */ +/* $NetBSD: if_cdce.c,v 1.75 2022/03/03 05:55:01 riastradh Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul <wpaul@windriver.com> @@ -40,7 +40,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v 1.74 2022/03/03 05:52:20 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v 1.75 2022/03/03 05:55:01 riastradh Exp $"); #include <sys/param.h> @@ -261,13 +261,9 @@ cdce_uno_init(struct ifnet *ifp) struct usbnet *un = ifp->if_softc; int rv; - if (usbnet_isdying(un)) - rv = EIO; - else { - usbnet_stop(un, ifp, 1); - rv = usbnet_init_rx_tx(un); - usbnet_set_link(un, rv == 0); - } + usbnet_stop(un, ifp, 1); + rv = usbnet_init_rx_tx(un); + usbnet_set_link(un, rv == 0); return rv; } diff --git a/sys/dev/usb/if_cue.c b/sys/dev/usb/if_cue.c index 4f9eff83d2b..7ea4cd2bd10 100644 --- a/sys/dev/usb/if_cue.c +++ b/sys/dev/usb/if_cue.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_cue.c,v 1.102 2022/03/03 05:54:37 riastradh Exp $ */ +/* $NetBSD: if_cue.c,v 1.103 2022/03/03 05:55:01 riastradh Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -57,7 +57,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_cue.c,v 1.102 2022/03/03 05:54:37 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_cue.c,v 1.103 2022/03/03 05:55:01 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -617,9 +617,6 @@ cue_uno_init(struct ifnet *ifp) DPRINTFN(10,("%s: %s: enter\n", device_xname(un->un_dev),__func__)); - if (usbnet_isdying(un)) - return ENXIO; - /* Cancel pending I/O */ usbnet_stop(un, ifp, 1); diff --git a/sys/dev/usb/if_kue.c b/sys/dev/usb/if_kue.c index 67935002a14..2a0144fdcf8 100644 --- a/sys/dev/usb/if_kue.c +++ b/sys/dev/usb/if_kue.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_kue.c,v 1.114 2022/03/03 05:53:33 riastradh Exp $ */ +/* $NetBSD: if_kue.c,v 1.115 2022/03/03 05:55:01 riastradh Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -71,7 +71,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_kue.c,v 1.114 2022/03/03 05:53:33 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_kue.c,v 1.115 2022/03/03 05:55:01 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -599,9 +599,6 @@ kue_uno_init(struct ifnet *ifp) DPRINTFN(5,("%s: %s: enter\n", device_xname(un->un_dev),__func__)); - if (usbnet_isdying(un)) - return EIO; - /* Cancel pending I/O */ usbnet_stop(un, ifp, 1); diff --git a/sys/dev/usb/if_mos.c b/sys/dev/usb/if_mos.c index 233cc5d8528..5198df0cb7f 100644 --- a/sys/dev/usb/if_mos.c +++ b/sys/dev/usb/if_mos.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_mos.c,v 1.17 2022/03/03 05:54:21 riastradh Exp $ */ +/* $NetBSD: if_mos.c,v 1.18 2022/03/03 05:55:01 riastradh Exp $ */ /* $OpenBSD: if_mos.c,v 1.40 2019/07/07 06:40:10 kevlo Exp $ */ /* @@ -72,7 +72,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_mos.c,v 1.17 2022/03/03 05:54:21 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_mos.c,v 1.18 2022/03/03 05:55:01 riastradh Exp $"); #include <sys/param.h> @@ -732,9 +732,6 @@ mos_uno_init(struct ifnet *ifp) u_int8_t rxmode; unsigned char ipgs[2]; - if (usbnet_isdying(un)) - return EIO; - /* Cancel pending I/O */ usbnet_stop(un, ifp, 1); diff --git a/sys/dev/usb/if_mue.c b/sys/dev/usb/if_mue.c index 4be471d6567..2b1b42784f2 100644 --- a/sys/dev/usb/if_mue.c +++ b/sys/dev/usb/if_mue.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_mue.c,v 1.77 2022/03/03 05:54:37 riastradh Exp $ */ +/* $NetBSD: if_mue.c,v 1.78 2022/03/03 05:55:01 riastradh Exp $ */ /* $OpenBSD: if_mue.c,v 1.3 2018/08/04 16:42:46 jsg Exp $ */ /* @@ -20,7 +20,7 @@ /* Driver for Microchip LAN7500/LAN7800 chipsets. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.77 2022/03/03 05:54:37 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.78 2022/03/03 05:55:01 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -1233,11 +1233,6 @@ mue_uno_init(struct ifnet *ifp) { struct usbnet * const un = ifp->if_softc; - if (usbnet_isdying(un)) { - DPRINTF(un, "dying\n"); - return EIO; - } - /* Cancel pending I/O and free all TX/RX buffers. */ if (ifp->if_flags & IFF_RUNNING) usbnet_stop(un, ifp, 1); diff --git a/sys/dev/usb/if_smsc.c b/sys/dev/usb/if_smsc.c index 1713125ada6..50393f5e06b 100644 --- a/sys/dev/usb/if_smsc.c +++ b/sys/dev/usb/if_smsc.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_smsc.c,v 1.87 2022/03/03 05:54:37 riastradh Exp $ */ +/* $NetBSD: if_smsc.c,v 1.88 2022/03/03 05:55:01 riastradh Exp $ */ /* $OpenBSD: if_smsc.c,v 1.4 2012/09/27 12:38:11 jsg Exp $ */ /* $FreeBSD: src/sys/dev/usb/net/if_smsc.c,v 1.1 2012/08/15 04:03:55 gonzo Exp $ */ @@ -61,7 +61,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_smsc.c,v 1.87 2022/03/03 05:54:37 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_smsc.c,v 1.88 2022/03/03 05:55:01 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -555,9 +555,6 @@ smsc_uno_init(struct ifnet *ifp) struct usbnet * const un = ifp->if_softc; struct smsc_softc * const sc = usbnet_softc(un); - if (usbnet_isdying(un)) - return EIO; - /* Cancel pending I/O */ usbnet_stop(un, ifp, 1); diff --git a/sys/dev/usb/if_udav.c b/sys/dev/usb/if_udav.c index d4a975c04e4..e93f22ac0aa 100644 --- a/sys/dev/usb/if_udav.c +++ b/sys/dev/usb/if_udav.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_udav.c,v 1.92 2022/03/03 05:54:37 riastradh Exp $ */ +/* $NetBSD: if_udav.c,v 1.93 2022/03/03 05:55:01 riastradh Exp $ */ /* $nabe: if_udav.c,v 1.3 2003/08/21 16:57:19 nabe Exp $ */ /* @@ -45,7 +45,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_udav.c,v 1.92 2022/03/03 05:54:37 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_udav.c,v 1.93 2022/03/03 05:55:01 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -471,10 +471,6 @@ udav_uno_init(struct ifnet *ifp) DPRINTF(("%s: %s: enter\n", device_xname(un->un_dev), __func__)); - if (usbnet_isdying(un)) { - return EIO; - } - /* Cancel pending I/O and free all TX/RX buffers */ if (ifp->if_flags & IFF_RUNNING) usbnet_stop(un, ifp, 1); diff --git a/sys/dev/usb/if_upl.c b/sys/dev/usb/if_upl.c index 5ca19d2a4c6..041cb356bb8 100644 --- a/sys/dev/usb/if_upl.c +++ b/sys/dev/usb/if_upl.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_upl.c,v 1.72 2022/03/03 05:50:22 riastradh Exp $ */ +/* $NetBSD: if_upl.c,v 1.73 2022/03/03 05:55:01 riastradh Exp $ */ /* * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_upl.c,v 1.72 2022/03/03 05:50:22 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_upl.c,v 1.73 2022/03/03 05:55:01 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -257,10 +257,7 @@ upl_uno_init(struct ifnet *ifp) struct usbnet * const un = ifp->if_softc; int rv; - if (usbnet_isdying(un)) - rv = EIO; - else - rv = usbnet_init_rx_tx(un); + rv = usbnet_init_rx_tx(un); return rv; } diff --git a/sys/dev/usb/if_ure.c b/sys/dev/usb/if_ure.c index 0f8c8f78122..5c6c6ab83cd 100644 --- a/sys/dev/usb/if_ure.c +++ b/sys/dev/usb/if_ure.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_ure.c,v 1.52 2022/03/03 05:54:37 riastradh Exp $ */ +/* $NetBSD: if_ure.c,v 1.53 2022/03/03 05:55:01 riastradh Exp $ */ /* $OpenBSD: if_ure.c,v 1.10 2018/11/02 21:32:30 jcs Exp $ */ /*- @@ -30,7 +30,7 @@ /* RealTek RTL8152/RTL8153 10/100/Gigabit USB Ethernet device */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_ure.c,v 1.52 2022/03/03 05:54:37 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ure.c,v 1.53 2022/03/03 05:55:01 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -413,9 +413,6 @@ ure_uno_init(struct ifnet *ifp) struct usbnet * const un = ifp->if_softc; uint8_t eaddr[8]; - if (usbnet_isdying(un)) - return EIO; - /* Cancel pending I/O. */ if (ifp->if_flags & IFF_RUNNING) usbnet_stop(un, ifp, 1); diff --git a/sys/dev/usb/if_url.c b/sys/dev/usb/if_url.c index 4f7ce1bf4ca..d15540e537c 100644 --- a/sys/dev/usb/if_url.c +++ b/sys/dev/usb/if_url.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_url.c,v 1.91 2022/03/03 05:54:37 riastradh Exp $ */ +/* $NetBSD: if_url.c,v 1.92 2022/03/03 05:55:01 riastradh Exp $ */ /* * Copyright (c) 2001, 2002 @@ -44,7 +44,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_url.c,v 1.91 2022/03/03 05:54:37 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_url.c,v 1.92 2022/03/03 05:55:01 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -370,9 +370,6 @@ url_uno_init(struct ifnet *ifp) DPRINTF(("%s: %s: enter\n", device_xname(un->un_dev), __func__)); - if (usbnet_isdying(un)) - return EIO; - /* Cancel pending I/O and free all TX/RX buffers */ usbnet_stop(un, ifp, 1); |
