Fix duplicate sc_dying usage.
All drivers which depend on ucom interfaces should use only one sc_dying.
This commit is contained in:
parent
bef8f3cabd
commit
7445c1e8b2
@ -115,8 +115,6 @@ struct uftdi_softc {
|
||||
u_char sc_msr;
|
||||
u_char sc_lsr;
|
||||
|
||||
u_char sc_dying;
|
||||
|
||||
u_int last_lcr;
|
||||
};
|
||||
|
||||
@ -289,7 +287,7 @@ uftdi_activate(device_ptr_t self, enum devact act)
|
||||
case DVACT_DEACTIVATE:
|
||||
if (sc->sc_subdev != NULL)
|
||||
rv = config_deactivate(sc->sc_subdev);
|
||||
sc->sc_dying = 1;
|
||||
sc->sc_ucom.sc_dying = 1;
|
||||
break;
|
||||
}
|
||||
return (rv);
|
||||
@ -303,7 +301,7 @@ USB_DETACH(uftdi)
|
||||
int rv = 0;
|
||||
|
||||
DPRINTF(("uftdi_detach: sc=%p\n", sc));
|
||||
sc->sc_dying = 1;
|
||||
sc->sc_ucom.sc_dying = 1;
|
||||
rv = ucom_detach(&sc->sc_ucom);
|
||||
|
||||
return rv;
|
||||
@ -313,14 +311,14 @@ Static int
|
||||
uftdi_open(void *vsc, int portno)
|
||||
{
|
||||
struct uftdi_softc *sc = vsc;
|
||||
struct ucom_softc *ucom = (struct ucom_softc *) vsc;
|
||||
struct ucom_softc *ucom = &sc->sc_ucom;
|
||||
usb_device_request_t req;
|
||||
usbd_status err;
|
||||
struct termios t;
|
||||
|
||||
DPRINTF(("uftdi_open: sc=%p\n", sc));
|
||||
|
||||
if (sc->sc_dying)
|
||||
if (ucom->sc_dying)
|
||||
return (EIO);
|
||||
|
||||
/* Perform a full reset on the device */
|
||||
@ -439,14 +437,14 @@ Static int
|
||||
uftdi_param(void *vsc, int portno, struct termios *t)
|
||||
{
|
||||
struct uftdi_softc *sc = vsc;
|
||||
struct ucom_softc *ucom = vsc;
|
||||
struct ucom_softc *ucom = &sc->sc_ucom;
|
||||
usb_device_request_t req;
|
||||
usbd_status err;
|
||||
int rate=0, data, flow;
|
||||
|
||||
DPRINTF(("uftdi_param: sc=%p\n", sc));
|
||||
|
||||
if (sc->sc_dying)
|
||||
if (ucom->sc_dying)
|
||||
return (EIO);
|
||||
|
||||
switch (sc->sc_type) {
|
||||
|
@ -145,7 +145,6 @@ struct umodem_softc {
|
||||
u_char sc_rts; /* current RTS state */
|
||||
|
||||
u_char sc_opening; /* lock during open */
|
||||
u_char sc_dying; /* disconnecting */
|
||||
|
||||
int sc_ctl_notify; /* Notification endpoint */
|
||||
usbd_pipe_handle sc_notify_pipe; /* Notification pipe */
|
||||
@ -391,7 +390,6 @@ USB_ATTACH(umodem)
|
||||
|
||||
bad:
|
||||
ucom->sc_dying = 1;
|
||||
sc->sc_dying = 1;
|
||||
free(devinfo, M_USBDEV);
|
||||
USB_ATTACH_ERROR_RETURN;
|
||||
}
|
||||
@ -447,7 +445,7 @@ umodem_intr(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
|
||||
struct umodem_softc *sc = priv;
|
||||
u_char mstatus;
|
||||
|
||||
if (sc->sc_dying)
|
||||
if (sc->sc_ucom.sc_dying)
|
||||
return;
|
||||
|
||||
if (status != USBD_NORMAL_COMPLETION) {
|
||||
@ -588,7 +586,7 @@ umodem_ioctl(void *addr, int portno, u_long cmd, caddr_t data, int flag,
|
||||
struct umodem_softc *sc = addr;
|
||||
int error = 0;
|
||||
|
||||
if (sc->sc_dying)
|
||||
if (sc->sc_ucom.sc_dying)
|
||||
return (EIO);
|
||||
|
||||
DPRINTF(("umodemioctl: cmd=0x%08lx\n", cmd));
|
||||
@ -785,7 +783,6 @@ USB_DETACH(umodem)
|
||||
usbd_close_pipe(sc->sc_notify_pipe);
|
||||
sc->sc_notify_pipe = NULL;
|
||||
}
|
||||
sc->sc_dying = 1;
|
||||
|
||||
sc->sc_ucom.sc_dying = 1;
|
||||
rv = ucom_detach(&sc->sc_ucom);
|
||||
|
Loading…
x
Reference in New Issue
Block a user