]> git.hungrycats.org Git - linux/commitdiff
[PATCH] USB vicam driver update
authorGreg Kroah-Hartman <greg@kroah.com>
Tue, 5 Feb 2002 09:17:21 +0000 (01:17 -0800)
committerGreg Kroah-Hartman <greg@kroah.com>
Tue, 5 Feb 2002 09:17:21 +0000 (01:17 -0800)
Here's a patch against 2.5.3 for the USB vicam driver that removes the
use of interruptible_sleep_on() in the driver.  This patch was done by
Oliver Neukum.

drivers/usb/vicam.c

index 069383fac14f0e0bb7a29a6b86d2dd30bb2f356d..d7dc679d5461656727de82be8fd8cadf0bfa21bb 100644 (file)
@@ -79,7 +79,7 @@ static int video_nr = -1;             /* next avail video device */
 static struct usb_driver vicam_driver;
 
 static char *buf, *buf2;
-static int change_pending = 0; 
+static volatile int change_pending = 0; 
 
 static int vicam_parameters(struct usb_vicam *vicam);
 
@@ -330,8 +330,14 @@ static int vicam_get_picture(struct usb_vicam *vicam, struct video_picture *p)
 
 static void synchronize(struct usb_vicam *vicam)
 {
+       DECLARE_WAITQUEUE(wait, current);
        change_pending = 1;
-       interruptible_sleep_on(&vicam->wait);
+       set_current_state(TASK_INTERRUPTIBLE);
+       add_wait_queue(&vicam->wait, &wait);
+       if (change_pending)
+               schedule();
+       remove_wait_queue(&vicam->wait, &wait);
+       set_current_state(TASK_RUNNING);
        vicam_sndctrl(1, vicam, VICAM_REQ_CAMERA_POWER, 0x00, NULL, 0);
        mdelay(10);
        vicam_sndctrl(1, vicam, VICAM_REQ_LED_CONTROL, 0x00, NULL, 0);