Initial revision
[linux-2.6.git] / drivers / usb / media / usbvideo.c
index 543d465..63a72e5 100644 (file)
@@ -725,7 +725,7 @@ int usbvideo_register(
                /* Allocate user_data separately because of kmalloc's limits */
                if (num_extra > 0) {
                        up->user_size = num_cams * num_extra;
-                       up->user_data = (char *) kmalloc(up->user_size, GFP_KERNEL);
+                       up->user_data = kmalloc(up->user_size, GFP_KERNEL);
                        if (up->user_data == NULL) {
                                err("%s: Failed to allocate user_data (%d. bytes)",
                                    __FUNCTION__, up->user_size);
@@ -953,9 +953,10 @@ static struct file_operations usbvideo_fops = {
        .read =   usbvideo_v4l_read,
        .mmap =   usbvideo_v4l_mmap,
        .ioctl =  usbvideo_v4l_ioctl,
+       .compat_ioctl = v4l_compat_ioctl32,
        .llseek = no_llseek,
 };
-static struct video_device usbvideo_template = {
+static const struct video_device usbvideo_template = {
        .owner =      THIS_MODULE,
        .type =       VID_TYPE_CAPTURE,
        .hardware =   VID_HARDWARE_CPIA,
@@ -1169,10 +1170,8 @@ static int usbvideo_v4l_open(struct inode *inode, struct file *file)
                        }
                        RingQueue_Free(&uvd->dp);
                        for (i=0; i < USBVIDEO_NUMSBUF; i++) {
-                               if (uvd->sbuf[i].data != NULL) {
-                                       kfree (uvd->sbuf[i].data);
-                                       uvd->sbuf[i].data = NULL;
-                               }
+                               kfree(uvd->sbuf[i].data);
+                               uvd->sbuf[i].data = NULL;
                        }
                }
        }
@@ -1814,12 +1813,12 @@ static void usbvideo_StopDataPump(struct uvd *uvd)
 {
        int i, j;
 
-       if (uvd->debug > 1)
-               info("%s($%p)", __FUNCTION__, uvd);
-
        if ((uvd == NULL) || (!uvd->streaming) || (uvd->dev == NULL))
                return;
 
+       if (uvd->debug > 1)
+               info("%s($%p)", __FUNCTION__, uvd);
+
        /* Unschedule all of the iso td's */
        for (i=0; i < USBVIDEO_NUMSBUF; i++) {
                usb_kill_urb(uvd->sbuf[i].urb);