static void dabusb_disconnect (struct usb_interface *intf)
{
+ wait_queue_t __wait;
pdabusb_t s = usb_get_intfdata (intf);
dbg("dabusb_disconnect");
-
+
+ init_waitqueue_entry(&__wait, current);
+
usb_set_intfdata (intf, NULL);
if (s) {
usb_deregister_dev (intf, &dabusb_class);
s->remove_pending = 1;
wake_up (&s->wait);
+ add_wait_queue(&s->remove_ok, &__wait);
+ set_current_state(TASK_UNINTERRUPTIBLE);
if (s->state == _started)
- sleep_on (&s->remove_ok);
+ schedule();
+ current->state = TASK_RUNNING;
+ remove_wait_queue(&s->remove_ok, &__wait);
+
s->usbdev = NULL;
s->overruns = 0;
}
{
struct usb_device *usbdev = interface_to_usbdev(intf);
pauerswald_t cp = NULL;
- DECLARE_WAIT_QUEUE_HEAD (wqh);
unsigned int u = 0;
char *pbuf;
int ret;
dbg ("Version is %X", cp->version);
/* allow some time to settle the device */
- sleep_on_timeout (&wqh, HZ / 3 );
+ set_current_state(TASK_UNINTERRUPTIBLE);
+ schedule_timeout(HZ/3);
/* Try to get a suitable textual description of the device */
/* Device name:*/
static void
tiglusb_disconnect (struct usb_interface *intf)
{
+ wait_queue_t __wait;
ptiglusb_t s = usb_get_intfdata (intf);
+
+ init_waitqueue_entry(&__wait, current);
+
usb_set_intfdata (intf, NULL);
if (!s || !s->dev) {
s->remove_pending = 1;
wake_up (&s->wait);
+ add_wait_queue(&s->wait, &__wait);
+ set_current_state(TASK_UNINTERRUPTIBLE);
if (s->state == _started)
- sleep_on (&s->remove_ok);
+ schedule();
+ current->state = TASK_RUNNING;
+ remove_wait_queue(&s->wait, &__wait);
down (&s->mutex);
s->dev = NULL;
s->opened = 0;