Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src-draft/trunk]: src/sys/dev/usb Adapt to recent usb changes.



details:   https://anonhg.NetBSD.org/src-all/rev/11b3d69e94c7
branches:  trunk
changeset: 365108:11b3d69e94c7
user:      Martin Husemann <martin%NetBSD.org@localhost>
date:      Sat Mar 05 19:50:41 2022 +0100

description:
Adapt to recent usb changes.

usbd_close_pipe() and usbd_abort_pipe() can not fail anymore.

diffstat:

 sys/dev/usb/usbwifi.c |  16 +++-------------
 1 files changed, 3 insertions(+), 13 deletions(-)

diffs (47 lines):

diff -r afce628c8412 -r 11b3d69e94c7 sys/dev/usb/usbwifi.c
--- a/sys/dev/usb/usbwifi.c     Sun Mar 06 03:51:27 2022 +1100
+++ b/sys/dev/usb/usbwifi.c     Sat Mar 05 19:50:41 2022 +0100
@@ -656,10 +656,7 @@
        for (size_t i = 0; i < __arraycount(unp->uwp_ep); i++) {
                if (unp->uwp_ep[i] == NULL)
                        continue;
-               usbd_status err = usbd_close_pipe(unp->uwp_ep[i]);
-               if (err)
-                       aprint_error_dev(un->uw_dev, "close pipe %zu: %s\n", i,
-                           usbd_errstr(err));
+               usbd_close_pipe(unp->uwp_ep[i]);
                unp->uwp_ep[i] = NULL;
        }
 }
@@ -703,9 +700,7 @@
        for (size_t i = 0; i < __arraycount(unp->uwp_ep); i++) {
                if (unp->uwp_ep[i] == NULL)
                        continue;
-               usbd_status err2 = usbd_abort_pipe(unp->uwp_ep[i]);
-               if (err == USBD_NORMAL_COMPLETION && err2)
-                       err = err2;
+               usbd_abort_pipe(unp->uwp_ep[i]);
        }
 
        return err;
@@ -1031,7 +1026,6 @@
        USBWIFIHIST_FUNC(); USBWIFIHIST_CALLED();
        struct usbwifi_private * const uwp = uw->uw_pri;
        struct usbwifi_cdata * const cd = uw_cdata(uw);
-       usbd_status err;
        unsigned prio;
        bool found;
 
@@ -1044,11 +1038,7 @@
                DPRINTF("prio %ju: uwcd_tx_cnt=%ju non zero, "
                    "aborting pipe", prio, 
                    cd->uwcd_tx_chains[prio].uwscd_tx_cnt, 0, 0);
-               err = usbd_abort_pipe(uwp->uwp_ep[prio]);
-               if (err)
-                       aprint_error_dev(uw->uw_dev,
-                           "pipe abort failed: %s\n",
-                           usbd_errstr(err));
+               usbd_abort_pipe(uwp->uwp_ep[prio]);
                if (cd->uwcd_tx_chains[prio].uwscd_tx_cnt > 0) {
                        DPRINTF("tx_cnt now %ju", 
                         cd->uwcd_tx_chains[prio].uwscd_tx_cnt,



Home | Main Index | Thread Index | Old Index