diff options
author | 2013-11-07 10:32:51 +0000 | |
---|---|---|
committer | 2013-11-07 10:32:51 +0000 | |
commit | cbb8e2d402387c84ae554cf2009f248cdb0a0db3 (patch) | |
tree | ed8301753af7aa1fc0ff4b1b2672bfd1ec0e2047 /sys/dev/usb/uts.c | |
parent | Make sure to mark the controller as dying in order to stop processing (diff) | |
download | wireguard-openbsd-cbb8e2d402387c84ae554cf2009f248cdb0a0db3.tar.xz wireguard-openbsd-cbb8e2d402387c84ae554cf2009f248cdb0a0db3.zip |
Replace sc_dying in favour of usbd_is_dying() and usbd_deactivate().
Okay mpi@
Diffstat (limited to 'sys/dev/usb/uts.c')
-rw-r--r-- | sys/dev/usb/uts.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/sys/dev/usb/uts.c b/sys/dev/usb/uts.c index 7d7aedf13bc..7b2c2efa0fe 100644 --- a/sys/dev/usb/uts.c +++ b/sys/dev/usb/uts.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uts.c,v 1.31 2013/04/15 09:23:02 mglocker Exp $ */ +/* $OpenBSD: uts.c,v 1.32 2013/11/07 10:33:43 pirofti Exp $ */ /* * Copyright (c) 2007 Robert Nagy <robert@openbsd.org> @@ -78,7 +78,6 @@ struct uts_softc { int sc_enabled; int sc_buttons; - int sc_dying; int sc_oldx; int sc_oldy; int sc_rawmode; @@ -173,7 +172,7 @@ uts_attach(struct device *parent, struct device *self, void *aux) if (usbd_set_config_index(uaa->device, UTS_CONFIG_INDEX, 1) != 0) { printf("%s: could not set configuartion no\n", sc->sc_dev.dv_xname); - sc->sc_dying = 1; + usbd_deactivate(sc->sc_udev); return; } @@ -182,7 +181,7 @@ uts_attach(struct device *parent, struct device *self, void *aux) if (cdesc == NULL) { printf("%s: failed to get configuration descriptor\n", sc->sc_dev.dv_xname); - sc->sc_dying = 1; + usbd_deactivate(sc->sc_udev); return; } @@ -190,7 +189,7 @@ uts_attach(struct device *parent, struct device *self, void *aux) if (usbd_device2interface_handle(uaa->device, 0, &sc->sc_iface) != 0) { printf("%s: failed to get interface\n", sc->sc_dev.dv_xname); - sc->sc_dying = 1; + usbd_deactivate(sc->sc_udev); return; } @@ -203,7 +202,7 @@ uts_attach(struct device *parent, struct device *self, void *aux) if (ed == NULL) { printf("%s: no endpoint descriptor for %d\n", sc->sc_dev.dv_xname, i); - sc->sc_dying = 1; + usbd_deactivate(sc->sc_udev); return; } @@ -217,7 +216,7 @@ uts_attach(struct device *parent, struct device *self, void *aux) if (sc->sc_intr_number== -1) { printf("%s: Could not find interrupt in\n", sc->sc_dev.dv_xname); - sc->sc_dying = 1; + usbd_deactivate(sc->sc_udev); return; } @@ -257,7 +256,7 @@ uts_activate(struct device *self, int act) case DVACT_DEACTIVATE: if (sc->sc_wsmousedev != NULL) rv = config_deactivate(sc->sc_wsmousedev); - sc->sc_dying = 1; + usbd_deactivate(sc->sc_udev); break; } @@ -270,7 +269,7 @@ uts_enable(void *v) struct uts_softc *sc = v; int err; - if (sc->sc_dying) + if (usbd_is_dying(sc->sc_udev)) return (EIO); if (sc->sc_enabled) |