int uhidread(dev_t dev, struct uio *uio, int flag) { struct uhid_softc *sc; int error; sc = uhid_cd.cd_devs[UHIDUNIT(dev)]; sc->sc_refcnt++; error = uhid_do_read(sc, uio, flag); if (--sc->sc_refcnt < 0) usb_detach_wakeup(&sc->sc_hdev.sc_dev); return (error); }
int uhidread(dev_t dev, struct uio *uio, int flag) { struct uhid_softc *sc; int error; USB_GET_SC(uhid, UHIDUNIT(dev), sc); sc->sc_refcnt++; error = uhid_do_read(sc, uio, flag); if (--sc->sc_refcnt < 0) usb_detach_wakeup(USBDEV(sc->sc_dev)); return (error); }