summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorKevin Lo <kevlo@cvs.openbsd.org>2021-08-20 04:54:11 +0000
committerKevin Lo <kevlo@cvs.openbsd.org>2021-08-20 04:54:11 +0000
commitfa97a14b68ead961aa2051e7f41f271acd130537 (patch)
treec32762cba99995b55945db844e67d8df02d9709c /sys
parenta7bcf538edf1bd610fe192a98ac917c85f86f1ec (diff)
Back out last commit.
deraadt@ pointed out that the operation is correct. It attaches, but by then it is being pulled. The dying flag is set to avoid half the kinds of failure conditions. The other half of the failure conditions are detect on-the-spot. And it seems when compiled for debug, this on-the-spot check which notices the device isn't there, has a printf.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/if_ure.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/dev/usb/if_ure.c b/sys/dev/usb/if_ure.c
index 75d7cbaf215..31e92826594 100644
--- a/sys/dev/usb/if_ure.c
+++ b/sys/dev/usb/if_ure.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ure.c,v 1.27 2021/08/20 01:40:51 kevlo Exp $ */
+/* $OpenBSD: if_ure.c,v 1.28 2021/08/20 04:54:10 kevlo Exp $ */
/*-
* Copyright (c) 2015, 2016, 2019 Kevin Lo <kevlo@openbsd.org>
* Copyright (c) 2020 Jonathon Fletcher <jonathon.fletcher@gmail.com>
@@ -223,7 +223,7 @@ ure_ctl(struct ure_softc *sc, uint8_t rw, uint16_t val, uint16_t index,
usbd_status err;
if (usbd_is_dying(sc->ure_udev))
- return -1;
+ return 0;
if (rw == URE_CTL_WRITE)
req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
@@ -239,8 +239,6 @@ ure_ctl(struct ure_softc *sc, uint8_t rw, uint16_t val, uint16_t index,
err = usbd_do_request(sc->ure_udev, &req, buf);
if (err) {
DPRINTF(("ure_ctl: error %d\n", err));
- if (err == USBD_CANCELLED || err == USBD_TIMEOUT)
- usbd_deactivate(sc->ure_udev);
return -1;
}