- patches.suse/slab-handle-memoryless-nodes-v2a.patch: Refresh.
[linux-flexiantxendom0-3.2.10.git] / drivers / staging / cx25821 / cx25821-video1.c
index a4dddc6..e3f3c4a 100644 (file)
@@ -94,37 +94,21 @@ static struct videobuf_queue_ops cx25821_video_qops = {
 
 static int video_open(struct file *file)
 {
-       int minor = video_devdata(file)->minor;
-       struct cx25821_dev *h, *dev = NULL;
+       struct video_device *vdev = video_devdata(file);
+       struct cx25821_dev *dev = video_drvdata(file);
        struct cx25821_fh *fh;
-       struct list_head *list;
-       enum v4l2_buf_type type = 0;
+       enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
        u32 pix_format;
 
-       lock_kernel();
-       list_for_each(list, &cx25821_devlist) {
-               h = list_entry(list, struct cx25821_dev, devlist);
-
-               if (h->video_dev[SRAM_CH01]
-                   && h->video_dev[SRAM_CH01]->minor == minor) {
-                       dev = h;
-                       type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-               }
-       }
-
-       if (NULL == dev) {
-               unlock_kernel();
-               return -ENODEV;
-       }
-
-       printk("open minor=%d type=%s\n", minor, v4l2_type_names[type]);
+       printk("open dev=%s type=%s\n", video_device_node_name(vdev),
+               v4l2_type_names[type]);
 
        /* allocate + initialize per filehandle data */
        fh = kzalloc(sizeof(*fh), GFP_KERNEL);
-       if (NULL == fh) {
-               unlock_kernel();
+       if (NULL == fh)
                return -ENOMEM;
-       }
+
+       lock_kernel();
 
        file->private_data = fh;
        fh->dev = dev;
@@ -444,7 +428,6 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = {
 struct video_device cx25821_video_template1 = {
        .name = "cx25821-video",
        .fops = &video_fops,
-       .minor = -1,
        .ioctl_ops = &video_ioctl_ops,
        .tvnorms = CX25821_NORMS,
        .current_norm = V4L2_STD_NTSC_M,