--- src/sys/dev/usbmisc/uscanner/uscanner.c 2004/05/19 22:52:52 1.9 +++ src/sys/dev/usbmisc/uscanner/uscanner.c 2005/06/02 20:41:05 1.10 @@ -72,6 +72,7 @@ #include #include #include +#include #include #include @@ -626,7 +627,6 @@ uscanner_activate(device_ptr_t self, enu USB_DETACH(uscanner) { USB_DETACH_START(uscanner, sc); - int s; #if defined(__NetBSD__) || defined(__OpenBSD__) int maj, mn; #endif @@ -646,12 +646,12 @@ USB_DETACH(uscanner) if (sc->sc_bulkout_pipe != NULL) usbd_abort_pipe(sc->sc_bulkout_pipe); - s = splusb(); + crit_enter(); if (--sc->sc_refcnt >= 0) { /* Wait for processes to go away. */ usb_detach_wait(USBDEV(sc->sc_dev)); } - splx(s); + crit_exit(); #if defined(__NetBSD__) || defined(__OpenBSD__) /* locate the major number */