diff options
| author | riastradh <riastradh@NetBSD.org> | 2022-03-03 06:06:52 +0000 |
|---|---|---|
| committer | riastradh <riastradh@NetBSD.org> | 2022-03-03 06:06:52 +0000 |
| commit | e7b19e0bd797446bac80fdfdba3c6ce8a40a4873 (patch) | |
| tree | 1061804dc5d3c126dae23d23341bde8966d1fa53 /sys/dev/usb | |
| parent | 47348cb26c3b84b3aad769f41717bfb58af5685a (diff) | |
usb: usbd_close_pipe never fails. Make it return void.
Prune dead branches as a result of this change.
Diffstat (limited to 'sys/dev/usb')
| -rw-r--r-- | sys/dev/usb/if_atu.c | 17 | ||||
| -rw-r--r-- | sys/dev/usb/if_urtw.c | 17 | ||||
| -rw-r--r-- | sys/dev/usb/ualea.c | 6 | ||||
| -rw-r--r-- | sys/dev/usb/usbdi.c | 8 | ||||
| -rw-r--r-- | sys/dev/usb/usbdi.h | 4 | ||||
| -rw-r--r-- | sys/dev/usb/usbnet.c | 9 |
6 files changed, 20 insertions, 41 deletions
diff --git a/sys/dev/usb/if_atu.c b/sys/dev/usb/if_atu.c index b2f8e007584..21b7c7813ab 100644 --- a/sys/dev/usb/if_atu.c +++ b/sys/dev/usb/if_atu.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_atu.c,v 1.74 2022/03/03 06:05:38 riastradh Exp $ */ +/* $NetBSD: if_atu.c,v 1.75 2022/03/03 06:06:52 riastradh Exp $ */ /* $OpenBSD: if_atu.c,v 1.48 2004/12/30 01:53:21 dlg Exp $ */ /* * Copyright (c) 2003, 2004 @@ -48,7 +48,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_atu.c,v 1.74 2022/03/03 06:05:38 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_atu.c,v 1.75 2022/03/03 06:06:52 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -2223,7 +2223,6 @@ atu_stop(struct ifnet *ifp, int disable) struct atu_softc *sc = ifp->if_softc; struct ieee80211com *ic = &sc->sc_ic; struct atu_cdata *cd; - usbd_status err; int s; s = splnet(); @@ -2249,20 +2248,12 @@ atu_stop(struct ifnet *ifp, int disable) /* Close pipes */ if (sc->atu_ep[ATU_ENDPT_RX] != NULL) { - err = usbd_close_pipe(sc->atu_ep[ATU_ENDPT_RX]); - if (err) { - DPRINTF(("%s: close rx pipe failed: %s\n", - device_xname(sc->atu_dev), usbd_errstr(err))); - } + usbd_close_pipe(sc->atu_ep[ATU_ENDPT_RX]); sc->atu_ep[ATU_ENDPT_RX] = NULL; } if (sc->atu_ep[ATU_ENDPT_TX] != NULL) { - err = usbd_close_pipe(sc->atu_ep[ATU_ENDPT_TX]); - if (err) { - DPRINTF(("%s: close tx pipe failed: %s\n", - device_xname(sc->atu_dev), usbd_errstr(err))); - } + usbd_close_pipe(sc->atu_ep[ATU_ENDPT_TX]); sc->atu_ep[ATU_ENDPT_TX] = NULL; } diff --git a/sys/dev/usb/if_urtw.c b/sys/dev/usb/if_urtw.c index 162141c8072..02d3252ae9d 100644 --- a/sys/dev/usb/if_urtw.c +++ b/sys/dev/usb/if_urtw.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_urtw.c,v 1.25 2021/12/31 14:25:24 riastradh Exp $ */ +/* $NetBSD: if_urtw.c,v 1.26 2022/03/03 06:06:52 riastradh Exp $ */ /* $OpenBSD: if_urtw.c,v 1.39 2011/07/03 15:47:17 matthew Exp $ */ /*- @@ -19,7 +19,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_urtw.c,v 1.25 2021/12/31 14:25:24 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_urtw.c,v 1.26 2022/03/03 06:06:52 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -829,24 +829,17 @@ urtw_close_pipes(struct urtw_softc *sc) usbd_status error = 0; if (sc->sc_rxpipe != NULL) { - error = usbd_close_pipe(sc->sc_rxpipe); - if (error != 0) - goto fail; + usbd_close_pipe(sc->sc_rxpipe); sc->sc_rxpipe = NULL; } if (sc->sc_txpipe_low != NULL) { - error = usbd_close_pipe(sc->sc_txpipe_low); - if (error != 0) - goto fail; + usbd_close_pipe(sc->sc_txpipe_low); sc->sc_txpipe_low = NULL; } if (sc->sc_txpipe_normal != NULL) { - error = usbd_close_pipe(sc->sc_txpipe_normal); - if (error != 0) - goto fail; + usbd_close_pipe(sc->sc_txpipe_normal); sc->sc_txpipe_normal = NULL; } -fail: return error; } diff --git a/sys/dev/usb/ualea.c b/sys/dev/usb/ualea.c index 70ae7c6649a..f8cadfe2ea8 100644 --- a/sys/dev/usb/ualea.c +++ b/sys/dev/usb/ualea.c @@ -1,4 +1,4 @@ -/* $NetBSD: ualea.c,v 1.14 2022/03/03 06:05:38 riastradh Exp $ */ +/* $NetBSD: ualea.c,v 1.15 2022/03/03 06:06:52 riastradh Exp $ */ /*- * Copyright (c) 2017 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ualea.c,v 1.14 2022/03/03 06:05:38 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ualea.c,v 1.15 2022/03/03 06:06:52 riastradh Exp $"); #include <sys/types.h> #include <sys/atomic.h> @@ -168,7 +168,7 @@ ualea_detach(device_t self, int flags) if (sc->sc_xfer) usbd_destroy_xfer(sc->sc_xfer); if (sc->sc_pipe) - (void)usbd_close_pipe(sc->sc_pipe); + usbd_close_pipe(sc->sc_pipe); mutex_destroy(&sc->sc_lock); return 0; diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c index 6325d9840cf..2807aee492e 100644 --- a/sys/dev/usb/usbdi.c +++ b/sys/dev/usb/usbdi.c @@ -1,4 +1,4 @@ -/* $NetBSD: usbdi.c,v 1.224 2022/03/03 06:05:38 riastradh Exp $ */ +/* $NetBSD: usbdi.c,v 1.225 2022/03/03 06:06:52 riastradh Exp $ */ /* * Copyright (c) 1998, 2012, 2015 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.224 2022/03/03 06:05:38 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.225 2022/03/03 06:06:52 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -321,7 +321,7 @@ usbd_open_pipe_intr(struct usbd_interface *iface, uint8_t address, return err; } -usbd_status +void usbd_close_pipe(struct usbd_pipe *pipe) { USBHIST_FUNC(); USBHIST_CALLED(usbdebug); @@ -348,8 +348,6 @@ usbd_close_pipe(struct usbd_pipe *pipe) if (pipe->up_iface) usbd_iface_pipeunref(pipe->up_iface); kmem_free(pipe, pipe->up_dev->ud_bus->ub_pipesize); - - return USBD_NORMAL_COMPLETION; } usbd_status diff --git a/sys/dev/usb/usbdi.h b/sys/dev/usb/usbdi.h index 4c8b0e6eb7a..1452614ee7b 100644 --- a/sys/dev/usb/usbdi.h +++ b/sys/dev/usb/usbdi.h @@ -1,4 +1,4 @@ -/* $NetBSD: usbdi.h,v 1.105 2022/03/03 06:05:38 riastradh Exp $ */ +/* $NetBSD: usbdi.h,v 1.106 2022/03/03 06:06:52 riastradh Exp $ */ /* $FreeBSD: src/sys/dev/usb/usbdi.h,v 1.18 1999/11/17 22:33:49 n_hibma Exp $ */ /* @@ -95,7 +95,7 @@ usbd_status usbd_open_pipe_intr(struct usbd_interface *, uint8_t, uint8_t, struct usbd_pipe **, void *, void *, uint32_t, usbd_callback, int); usbd_status usbd_open_pipe(struct usbd_interface *, uint8_t, uint8_t, struct usbd_pipe **); -usbd_status usbd_close_pipe(struct usbd_pipe *); +void usbd_close_pipe(struct usbd_pipe *); usbd_status usbd_transfer(struct usbd_xfer *); diff --git a/sys/dev/usb/usbnet.c b/sys/dev/usb/usbnet.c index 44d2bf58598..eb6a85519b5 100644 --- a/sys/dev/usb/usbnet.c +++ b/sys/dev/usb/usbnet.c @@ -1,4 +1,4 @@ -/* $NetBSD: usbnet.c,v 1.92 2022/03/03 06:05:38 riastradh Exp $ */ +/* $NetBSD: usbnet.c,v 1.93 2022/03/03 06:06:52 riastradh Exp $ */ /* * Copyright (c) 2019 Matthew R. Green @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.92 2022/03/03 06:05:38 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.93 2022/03/03 06:06:52 riastradh Exp $"); #include <sys/param.h> #include <sys/kernel.h> @@ -779,10 +779,7 @@ usbnet_ep_close_pipes(struct usbnet * const un) for (size_t i = 0; i < __arraycount(unp->unp_ep); i++) { if (unp->unp_ep[i] == NULL) continue; - usbd_status err = usbd_close_pipe(unp->unp_ep[i]); - if (err) - aprint_error_dev(un->un_dev, "close pipe %zu: %s\n", i, - usbd_errstr(err)); + usbd_close_pipe(unp->unp_ep[i]); unp->unp_ep[i] = NULL; } } |
