diff options
author | Paul Irofti <pirofti@cvs.openbsd.org> | 2013-11-07 07:32:37 +0000 |
---|---|---|
committer | Paul Irofti <pirofti@cvs.openbsd.org> | 2013-11-07 07:32:37 +0000 |
commit | 645638e20faf3394c2b76e4465f19c41651666ea (patch) | |
tree | 6e0d8e147fa628197885a4759afe66597001d87f /sys/dev/usb/umct.c | |
parent | c2f6f798739f1aa62635f491a73fbe12f97d3999 (diff) |
Replace sc_dying in favour of usbd_is_dying() and usbd_deactivate().
Okay mpi@
Diffstat (limited to 'sys/dev/usb/umct.c')
-rw-r--r-- | sys/dev/usb/umct.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/sys/dev/usb/umct.c b/sys/dev/usb/umct.c index b4d6ecd5013..e0f32d2b9c3 100644 --- a/sys/dev/usb/umct.c +++ b/sys/dev/usb/umct.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umct.c,v 1.36 2013/04/15 09:23:02 mglocker Exp $ */ +/* $OpenBSD: umct.c,v 1.37 2013/11/07 07:32:07 pirofti Exp $ */ /* $NetBSD: umct.c,v 1.10 2003/02/23 04:20:07 simonb Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -92,8 +92,6 @@ struct umct_softc { struct device *sc_subdev; /* ucom device */ - u_char sc_dying; /* disconnecting */ - u_char sc_lsr; /* Local status register */ u_char sc_msr; /* umct status register */ @@ -205,7 +203,7 @@ umct_attach(struct device *parent, struct device *self, void *aux) if (err) { printf("\n%s: failed to set configuration, err=%s\n", devname, usbd_errstr(err)); - sc->sc_dying = 1; + usbd_deactivate(sc->sc_udev); return; } @@ -215,7 +213,7 @@ umct_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; } @@ -225,7 +223,7 @@ umct_attach(struct device *parent, struct device *self, void *aux) if (err) { printf("\n%s: failed to get interface, err=%s\n", devname, usbd_errstr(err)); - sc->sc_dying = 1; + usbd_deactivate(sc->sc_udev); return; } @@ -239,7 +237,7 @@ umct_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; } @@ -265,21 +263,21 @@ umct_attach(struct device *parent, struct device *self, void *aux) if (uca.bulkin == -1) { printf("%s: Could not find data bulk in\n", sc->sc_dev.dv_xname); - sc->sc_dying = 1; + usbd_deactivate(sc->sc_udev); return; } if (uca.bulkout == -1) { printf("%s: Could not find data bulk out\n", sc->sc_dev.dv_xname); - sc->sc_dying = 1; + usbd_deactivate(sc->sc_udev); return; } 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; } @@ -339,7 +337,7 @@ umct_activate(struct device *self, int act) case DVACT_DEACTIVATE: if (sc->sc_subdev != NULL) rv = config_deactivate(sc->sc_subdev); - sc->sc_dying = 1; + usbd_deactivate(sc->sc_udev); break; } return (rv); @@ -531,7 +529,7 @@ umct_open(void *addr, int portno) struct umct_softc *sc = addr; int err, lcr_data; - if (sc->sc_dying) + if (usbd_is_dying(sc->sc_udev)) return (EIO); DPRINTF(("umct_open: sc=%p\n", sc)); @@ -564,7 +562,7 @@ umct_close(void *addr, int portno) struct umct_softc *sc = addr; int err; - if (sc->sc_dying) + if (usbd_is_dying(sc->sc_udev)) return; DPRINTF(("umct_close: close\n")); @@ -590,7 +588,7 @@ umct_intr(struct usbd_xfer *xfer, void *priv, usbd_status status) u_char *buf = sc->sc_intr_buf; u_char mstatus; - if (sc->sc_dying) + if (usbd_is_dying(sc->sc_udev)) return; if (status != USBD_NORMAL_COMPLETION) { |