V4L/DVB (9327): v4l: use video_device.num instead of minor in video%d
authorHans Verkuil <hverkuil@xs4all.nl>
Sun, 19 Oct 2008 21:54:26 +0000 (18:54 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 21 Oct 2008 16:31:37 +0000 (14:31 -0200)
The kernel number of a v4l2 node (e.g. videoX, radioX or vbiX) is now
independent of the minor number. So instead of using the minor field
of the video_device struct one has to use the num field: this always
contains the kernel number of the device node.

I forgot about this when I did the v4l2 core change, so this patch
converts all drivers that use it in one go. Luckily the change is
trivial.

Cc: michael@mihu.de
Cc: mchehab@infradead.org
Cc: corbet@lwn.net
Cc: luca.risolia@studio.unibo.it
Cc: isely@pobox.com
Cc: pe1rxq@amsat.org
Cc: royale@zerezo.com
Cc: mkrufky@linuxtv.org
Cc: stoth@linuxtv.org
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
29 files changed:
drivers/media/common/saa7146_fops.c
drivers/media/video/arv.c
drivers/media/video/bt8xx/bttv-driver.c
drivers/media/video/c-qcam.c
drivers/media/video/cafe_ccic.c
drivers/media/video/cpia.c
drivers/media/video/cpia2/cpia2_v4l.c
drivers/media/video/cx23885/cx23885-417.c
drivers/media/video/cx23885/cx23885-video.c
drivers/media/video/cx88/cx88-blackbird.c
drivers/media/video/cx88/cx88-video.c
drivers/media/video/em28xx/em28xx-video.c
drivers/media/video/et61x251/et61x251_core.c
drivers/media/video/pvrusb2/pvrusb2-v4l2.c
drivers/media/video/pwc/pwc-if.c
drivers/media/video/saa7134/saa7134-core.c
drivers/media/video/saa7134/saa7134-empress.c
drivers/media/video/se401.c
drivers/media/video/sn9c102/sn9c102_core.c
drivers/media/video/stk-webcam.c
drivers/media/video/stv680.c
drivers/media/video/usbvideo/usbvideo.c
drivers/media/video/usbvideo/vicam.c
drivers/media/video/usbvision/usbvision-i2c.c
drivers/media/video/usbvision/usbvision-video.c
drivers/media/video/vivi.c
drivers/media/video/w9968cf.c
drivers/media/video/zc0301/zc0301_core.c
drivers/media/video/zr364xx.c

index 5b34c134aa25147dc118a3cc44a3ba49365166f6..127b0526a727f15ac9bf6f570e05ac0f352c08a7 100644 (file)
@@ -545,11 +545,11 @@ int saa7146_register_device(struct video_device **vid, struct saa7146_dev* dev,
        if( VFL_TYPE_GRABBER == type ) {
                vv->video_minor = vfd->minor;
                INFO(("%s: registered device video%d [v4l2]\n",
-                       dev->name, vfd->minor & 0x1f));
+                       dev->name, vfd->num));
        } else {
                vv->vbi_minor = vfd->minor;
                INFO(("%s: registered device vbi%d [v4l2]\n",
-                       dev->name, vfd->minor & 0x1f));
+                       dev->name, vfd->num));
        }
 
        *vid = vfd;
index 218754b4906a7a4fee61b7840dc4b8ed1db92ad4..e09b006932308b81e3940dd204226538ac88afbc 100644 (file)
@@ -866,7 +866,7 @@ static int __init ar_init(void)
        }
 
        printk("video%d: Found M64278 VGA (IRQ %d, Freq %dMHz).\n",
-               ar->vdev->minor, M32R_IRQ_INT3, freq);
+               ar->vdev->num, M32R_IRQ_INT3, freq);
 
        return 0;
 
index 5858bf5ff41c3da1392bb21d337d13713bf56c45..9ec4cec2e52dada612a8857a1033325f6cb5415a 100644 (file)
@@ -4246,7 +4246,7 @@ static int __devinit bttv_register_video(struct bttv *btv)
                                  video_nr[btv->c.nr]) < 0)
                goto err;
        printk(KERN_INFO "bttv%d: registered device video%d\n",
-              btv->c.nr,btv->video_dev->minor & 0x1f);
+              btv->c.nr, btv->video_dev->num);
        if (device_create_file(&btv->video_dev->dev,
                                     &dev_attr_card)<0) {
                printk(KERN_ERR "bttv%d: device_create_file 'card' "
@@ -4263,7 +4263,7 @@ static int __devinit bttv_register_video(struct bttv *btv)
                                  vbi_nr[btv->c.nr]) < 0)
                goto err;
        printk(KERN_INFO "bttv%d: registered device vbi%d\n",
-              btv->c.nr,btv->vbi_dev->minor & 0x1f);
+              btv->c.nr, btv->vbi_dev->num);
 
        if (!btv->has_radio)
                return 0;
@@ -4275,7 +4275,7 @@ static int __devinit bttv_register_video(struct bttv *btv)
                                  radio_nr[btv->c.nr]) < 0)
                goto err;
        printk(KERN_INFO "bttv%d: registered device radio%d\n",
-              btv->c.nr,btv->radio_dev->minor & 0x1f);
+              btv->c.nr, btv->radio_dev->num);
 
        /* all done */
        return 0;
index 17aa0adb346703938b650c8c8164e3789eab5f88..0f930d35146619fea78c43a0370b6fec6fdaba0f 100644 (file)
@@ -815,7 +815,7 @@ static int init_cqcam(struct parport *port)
        }
 
        printk(KERN_INFO "video%d: Colour QuickCam found on %s\n",
-              qcam->vdev.minor, qcam->pport->name);
+              qcam->vdev.num, qcam->pport->name);
 
        qcams[num_cams++] = qcam;
 
index fc9497bdd322f008c6673ada3c7468be051c3706..a8c068e1de1cb30956e227e9d14a933c0c36735d 100644 (file)
@@ -2059,10 +2059,10 @@ static void cafe_dfs_cam_setup(struct cafe_camera *cam)
 
        if (!cafe_dfs_root)
                return;
-       sprintf(fname, "regs-%d", cam->v4ldev.minor);
+       sprintf(fname, "regs-%d", cam->v4ldev.num);
        cam->dfs_regs = debugfs_create_file(fname, 0444, cafe_dfs_root,
                        cam, &cafe_dfs_reg_ops);
-       sprintf(fname, "cam-%d", cam->v4ldev.minor);
+       sprintf(fname, "cam-%d", cam->v4ldev.num);
        cam->dfs_cam_regs = debugfs_create_file(fname, 0444, cafe_dfs_root,
                        cam, &cafe_dfs_cam_ops);
 }
index 1798b779a25a10993e767a469ee860317016a992..16c094f7785294230cdb5d9e1423fbf248454aa7 100644 (file)
@@ -1347,7 +1347,7 @@ static void create_proc_cpia_cam(struct cam_data *cam)
        if (!cpia_proc_root || !cam)
                return;
 
-       snprintf(name, sizeof(name), "video%d", cam->vdev.minor);
+       snprintf(name, sizeof(name), "video%d", cam->vdev.num);
 
        ent = create_proc_entry(name, S_IFREG|S_IRUGO|S_IWUSR, cpia_proc_root);
        if (!ent)
@@ -1372,7 +1372,7 @@ static void destroy_proc_cpia_cam(struct cam_data *cam)
        if (!cam || !cam->proc_entry)
                return;
 
-       snprintf(name, sizeof(name), "video%d", cam->vdev.minor);
+       snprintf(name, sizeof(name), "video%d", cam->vdev.num);
        remove_proc_entry(name, cpia_proc_root);
        cam->proc_entry = NULL;
 }
@@ -4005,7 +4005,7 @@ void cpia_unregister_camera(struct cam_data *cam)
        }
 
 #ifdef CONFIG_PROC_FS
-       DBG("destroying /proc/cpia/video%d\n", cam->vdev.minor);
+       DBG("destroying /proc/cpia/video%d\n", cam->vdev.num);
        destroy_proc_cpia_cam(cam);
 #endif
        if (!cam->open_count) {
index 897e8d1a5c3c0a08cadc5dfa470767c90095573d..1c6bd633f1939a5493bcef8a1e20f51df863aed9 100644 (file)
@@ -1973,7 +1973,7 @@ void cpia2_unregister_camera(struct camera_data *cam)
        } else {
                LOG("/dev/video%d removed while open, "
                    "deferring video_unregister_device\n",
-                   cam->vdev->minor);
+                   cam->vdev->num);
        }
 }
 
index 395c11fa47ceb486206eaf37f44145644762bc31..00831f3ef8f59b7f821d2281737987add37b74aa 100644 (file)
@@ -1815,7 +1815,7 @@ int cx23885_417_register(struct cx23885_dev *dev)
        cx23885_mc417_init(dev);
 
        printk(KERN_INFO "%s: registered device video%d [mpeg]\n",
-              dev->name, dev->v4l_device->minor & 0x1f);
+              dev->name, dev->v4l_device->num);
 
        return 0;
 }
index ab3110d6046ca08ac7fd2488da02fcaa19396bd2..c742a10be5cb2f9a94972b5f20d9eeb5ad355063 100644 (file)
@@ -1543,7 +1543,7 @@ int cx23885_video_register(struct cx23885_dev *dev)
                goto fail_unreg;
        }
        printk(KERN_INFO "%s/0: registered device video%d [v4l2]\n",
-              dev->name, dev->video_dev->minor & 0x1f);
+              dev->name, dev->video_dev->num);
        /* initial device configuration */
        mutex_lock(&dev->lock);
        cx23885_set_tvnorm(dev, dev->tvnorm);
index e71369754305cdfe21cab45990120115079aafa7..078be63195568433e9d673e6becd886415ce21b4 100644 (file)
@@ -1285,7 +1285,7 @@ static int blackbird_register_video(struct cx8802_dev *dev)
                return err;
        }
        printk(KERN_INFO "%s/2: registered device video%d [mpeg]\n",
-              dev->core->name,dev->mpeg_dev->minor & 0x1f);
+              dev->core->name, dev->mpeg_dev->num);
        return 0;
 }
 
index 3904b73f52ee2879ebc6058770d8692a80a57700..61265fd04d5603edb4198b7e4e46f3980a222b90 100644 (file)
@@ -1911,7 +1911,7 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
                goto fail_unreg;
        }
        printk(KERN_INFO "%s/0: registered device video%d [v4l2]\n",
-              core->name,dev->video_dev->minor & 0x1f);
+              core->name, dev->video_dev->num);
 
        dev->vbi_dev = cx88_vdev_init(core,dev->pci,&cx8800_vbi_template,"vbi");
        err = video_register_device(dev->vbi_dev,VFL_TYPE_VBI,
@@ -1922,7 +1922,7 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
                goto fail_unreg;
        }
        printk(KERN_INFO "%s/0: registered device vbi%d\n",
-              core->name,dev->vbi_dev->minor & 0x1f);
+              core->name, dev->vbi_dev->num);
 
        if (core->board.radio.type == CX88_RADIO) {
                dev->radio_dev = cx88_vdev_init(core,dev->pci,
@@ -1935,7 +1935,7 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
                        goto fail_unreg;
                }
                printk(KERN_INFO "%s/0: registered device radio%d\n",
-                      core->name,dev->radio_dev->minor & 0x1f);
+                      core->name, dev->radio_dev->num);
        }
 
        /* everything worked */
index c53649e5315b0a815cd09633578dfcea263b41cd..a1ab2ef45578d491ea9951ef1ddfe933b85294fb 100644 (file)
@@ -2042,7 +2042,7 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev,
                        goto fail_unreg;
                }
                em28xx_info("Registered radio device as /dev/radio%d\n",
-                           dev->radio_dev->minor & 0x1f);
+                           dev->radio_dev->num);
        }
 
        /* init video dma queues */
index 7a85c41b0eea3b592ccc7554707421a40d70aaa3..9d0ef96c23ff47c6147059ee9b3a2b28b5986067 100644 (file)
@@ -588,7 +588,7 @@ static int et61x251_stream_interrupt(struct et61x251_device* cam)
                cam->state |= DEV_MISCONFIGURED;
                DBG(1, "URB timeout reached. The camera is misconfigured. To "
                       "use it, close and open /dev/video%d again.",
-                   cam->v4ldev->minor);
+                   cam->v4ldev->num);
                return -EIO;
        }
 
@@ -1195,7 +1195,7 @@ static void et61x251_release_resources(struct kref *kref)
 
        cam = container_of(kref, struct et61x251_device, kref);
 
-       DBG(2, "V4L2 device /dev/video%d deregistered", cam->v4ldev->minor);
+       DBG(2, "V4L2 device /dev/video%d deregistered", cam->v4ldev->num);
        video_set_drvdata(cam->v4ldev, NULL);
        video_unregister_device(cam->v4ldev);
        usb_put_dev(cam->usbdev);
@@ -1237,7 +1237,7 @@ static int et61x251_open(struct inode* inode, struct file* filp)
 
        if (cam->users) {
                DBG(2, "Device /dev/video%d is already in use",
-                      cam->v4ldev->minor);
+                      cam->v4ldev->num);
                DBG(3, "Simultaneous opens are not supported");
                if ((filp->f_flags & O_NONBLOCK) ||
                    (filp->f_flags & O_NDELAY)) {
@@ -1280,7 +1280,7 @@ static int et61x251_open(struct inode* inode, struct file* filp)
        cam->frame_count = 0;
        et61x251_empty_framequeues(cam);
 
-       DBG(3, "Video device /dev/video%d is open", cam->v4ldev->minor);
+       DBG(3, "Video device /dev/video%d is open", cam->v4ldev->num);
 
 out:
        mutex_unlock(&cam->open_mutex);
@@ -1304,7 +1304,7 @@ static int et61x251_release(struct inode* inode, struct file* filp)
        cam->users--;
        wake_up_interruptible_nr(&cam->wait_open, 1);
 
-       DBG(3, "Video device /dev/video%d closed", cam->v4ldev->minor);
+       DBG(3, "Video device /dev/video%d closed", cam->v4ldev->num);
 
        kref_put(&cam->kref, et61x251_release_resources);
 
@@ -1845,7 +1845,7 @@ et61x251_vidioc_s_crop(struct et61x251_device* cam, void __user * arg)
                cam->state |= DEV_MISCONFIGURED;
                DBG(1, "VIDIOC_S_CROP failed because of hardware problems. To "
                       "use the camera, close and open /dev/video%d again.",
-                   cam->v4ldev->minor);
+                   cam->v4ldev->num);
                return -EIO;
        }
 
@@ -1858,7 +1858,7 @@ et61x251_vidioc_s_crop(struct et61x251_device* cam, void __user * arg)
                cam->state |= DEV_MISCONFIGURED;
                DBG(1, "VIDIOC_S_CROP failed because of not enough memory. To "
                       "use the camera, close and open /dev/video%d again.",
-                   cam->v4ldev->minor);
+                   cam->v4ldev->num);
                return -ENOMEM;
        }
 
@@ -2068,7 +2068,7 @@ et61x251_vidioc_try_s_fmt(struct et61x251_device* cam, unsigned int cmd,
                cam->state |= DEV_MISCONFIGURED;
                DBG(1, "VIDIOC_S_FMT failed because of hardware problems. To "
                       "use the camera, close and open /dev/video%d again.",
-                   cam->v4ldev->minor);
+                   cam->v4ldev->num);
                return -EIO;
        }
 
@@ -2080,7 +2080,7 @@ et61x251_vidioc_try_s_fmt(struct et61x251_device* cam, unsigned int cmd,
                cam->state |= DEV_MISCONFIGURED;
                DBG(1, "VIDIOC_S_FMT failed because of not enough memory. To "
                       "use the camera, close and open /dev/video%d again.",
-                   cam->v4ldev->minor);
+                   cam->v4ldev->num);
                return -ENOMEM;
        }
 
@@ -2128,7 +2128,7 @@ et61x251_vidioc_s_jpegcomp(struct et61x251_device* cam, void __user * arg)
                cam->state |= DEV_MISCONFIGURED;
                DBG(1, "VIDIOC_S_JPEGCOMP failed because of hardware "
                       "problems. To use the camera, close and open "
-                      "/dev/video%d again.", cam->v4ldev->minor);
+                      "/dev/video%d again.", cam->v4ldev->num);
                return -EIO;
        }
 
@@ -2605,7 +2605,7 @@ et61x251_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
                goto fail;
        }
 
-       DBG(2, "V4L2 device registered as /dev/video%d", cam->v4ldev->minor);
+       DBG(2, "V4L2 device registered as /dev/video%d", cam->v4ldev->num);
 
        cam->module_param.force_munmap = force_munmap[dev_nr];
        cam->module_param.frame_timeout = frame_timeout[dev_nr];
@@ -2658,7 +2658,7 @@ static void et61x251_usb_disconnect(struct usb_interface* intf)
        if (cam->users) {
                DBG(2, "Device /dev/video%d is open! Deregistration and "
                       "memory deallocation are deferred.",
-                   cam->v4ldev->minor);
+                   cam->v4ldev->num);
                cam->state |= DEV_MISCONFIGURED;
                et61x251_stop_transfer(cam);
                cam->state |= DEV_DISCONNECTED;
index f048d80b77e58b8e7e5e05ff9c2fec798929e135..43ef7ba75c8b6327015bd75829f181b6f1c18d58 100644 (file)
@@ -893,7 +893,7 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file,
 
 static void pvr2_v4l2_dev_destroy(struct pvr2_v4l2_dev *dip)
 {
-       int minor_id = dip->devbase.minor;
+       int num = dip->devbase.num;
        struct pvr2_hdw *hdw = dip->v4lp->channel.mc_head->hdw;
        enum pvr2_config cfg = dip->config;
        int v4l_type = dip->v4l_type;
@@ -909,7 +909,7 @@ static void pvr2_v4l2_dev_destroy(struct pvr2_v4l2_dev *dip)
        video_unregister_device(&dip->devbase);
 
        printk(KERN_INFO "pvrusb2: unregistered device %s%u [%s]\n",
-              get_v4l_name(v4l_type),minor_id & 0x1f,
+              get_v4l_name(v4l_type), num,
               pvr2_config_get_name(cfg));
 
 }
@@ -1310,7 +1310,7 @@ static void pvr2_v4l2_dev_init(struct pvr2_v4l2_dev *dip,
        }
 
        printk(KERN_INFO "pvrusb2: registered device %s%u [%s]\n",
-              get_v4l_name(dip->v4l_type),dip->devbase.minor & 0x1f,
+              get_v4l_name(dip->v4l_type), dip->devbase.num,
               pvr2_config_get_name(dip->config));
 
        pvr2_hdw_v4l_store_minor_number(vp->channel.mc_head->hdw,
index ab28389b4cdadf17d0e28282dd6c186237c2fe14..f3897a3fdb75b3542de06f693e60e213ed642f1a 100644 (file)
@@ -1795,7 +1795,7 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
                goto err;
        }
        else {
-               PWC_INFO("Registered as /dev/video%d.\n", pdev->vdev->minor & 0x3F);
+               PWC_INFO("Registered as /dev/video%d.\n", pdev->vdev->num);
        }
 
        /* occupy slot */
index b686bfabbde0defb53a765a8b3bf8978e1f21b0a..24918445294906ce9152c05db70d1748dfc6a9af 100644 (file)
@@ -996,7 +996,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
                goto fail4;
        }
        printk(KERN_INFO "%s: registered device video%d [v4l2]\n",
-              dev->name,dev->video_dev->minor & 0x1f);
+              dev->name, dev->video_dev->num);
 
        dev->vbi_dev = vdev_init(dev, &saa7134_video_template, "vbi");
 
@@ -1005,7 +1005,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
        if (err < 0)
                goto fail4;
        printk(KERN_INFO "%s: registered device vbi%d\n",
-              dev->name,dev->vbi_dev->minor & 0x1f);
+              dev->name, dev->vbi_dev->num);
 
        if (card_has_radio(dev)) {
                dev->radio_dev = vdev_init(dev,&saa7134_radio_template,"radio");
@@ -1014,7 +1014,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
                if (err < 0)
                        goto fail4;
                printk(KERN_INFO "%s: registered device radio%d\n",
-                      dev->name,dev->radio_dev->minor & 0x1f);
+                      dev->name, dev->radio_dev->num);
        }
 
        /* everything worked */
index 9a8766a78a0c31f45ddadeb561d4d837662730ba..7f40511bcc04b9493423d2fc9826d57e2473af98 100644 (file)
@@ -534,7 +534,7 @@ static int empress_init(struct saa7134_dev *dev)
                return err;
        }
        printk(KERN_INFO "%s: registered device video%d [mpeg]\n",
-              dev->name,dev->empress_dev->minor & 0x1f);
+              dev->name, dev->empress_dev->num);
 
        videobuf_queue_sg_init(&dev->empress_tsq, &saa7134_ts_qops,
                            &dev->pci->dev, &dev->slock,
index ae3949180c4ed3ace8801f67b94c24899e0b916f..044a2e94c34dc5e5708d6e3f0c4deb944a8ff263 100644 (file)
@@ -1412,7 +1412,7 @@ static int se401_probe(struct usb_interface *intf,
                return -EIO;
        }
        dev_info(&intf->dev, "registered new video device: video%d\n",
-                se401->vdev.minor);
+                se401->vdev.num);
 
        usb_set_intfdata (intf, se401);
        return 0;
index 20e30bd9364be9eb3d988079e8764029ed8543c9..fcd2b62f92c43506456437fa3b46f7469fc4d25c 100644 (file)
@@ -1008,7 +1008,7 @@ static int sn9c102_stream_interrupt(struct sn9c102_device* cam)
                cam->state |= DEV_MISCONFIGURED;
                DBG(1, "URB timeout reached. The camera is misconfigured. "
                       "To use it, close and open /dev/video%d again.",
-                   cam->v4ldev->minor);
+                   cam->v4ldev->num);
                return -EIO;
        }
 
@@ -1734,7 +1734,7 @@ static void sn9c102_release_resources(struct kref *kref)
 
        cam = container_of(kref, struct sn9c102_device, kref);
 
-       DBG(2, "V4L2 device /dev/video%d deregistered", cam->v4ldev->minor);
+       DBG(2, "V4L2 device /dev/video%d deregistered", cam->v4ldev->num);
        video_set_drvdata(cam->v4ldev, NULL);
        video_unregister_device(cam->v4ldev);
        usb_put_dev(cam->usbdev);
@@ -1792,7 +1792,7 @@ static int sn9c102_open(struct inode* inode, struct file* filp)
 
        if (cam->users) {
                DBG(2, "Device /dev/video%d is already in use",
-                      cam->v4ldev->minor);
+                      cam->v4ldev->num);
                DBG(3, "Simultaneous opens are not supported");
                /*
                   open() must follow the open flags and should block
@@ -1845,7 +1845,7 @@ static int sn9c102_open(struct inode* inode, struct file* filp)
        cam->frame_count = 0;
        sn9c102_empty_framequeues(cam);
 
-       DBG(3, "Video device /dev/video%d is open", cam->v4ldev->minor);
+       DBG(3, "Video device /dev/video%d is open", cam->v4ldev->num);
 
 out:
        mutex_unlock(&cam->open_mutex);
@@ -1870,7 +1870,7 @@ static int sn9c102_release(struct inode* inode, struct file* filp)
        cam->users--;
        wake_up_interruptible_nr(&cam->wait_open, 1);
 
-       DBG(3, "Video device /dev/video%d closed", cam->v4ldev->minor);
+       DBG(3, "Video device /dev/video%d closed", cam->v4ldev->num);
 
        kref_put(&cam->kref, sn9c102_release_resources);
 
@@ -2432,7 +2432,7 @@ sn9c102_vidioc_s_crop(struct sn9c102_device* cam, void __user * arg)
                cam->state |= DEV_MISCONFIGURED;
                DBG(1, "VIDIOC_S_CROP failed because of hardware problems. To "
                       "use the camera, close and open /dev/video%d again.",
-                   cam->v4ldev->minor);
+                   cam->v4ldev->num);
                return -EIO;
        }
 
@@ -2445,7 +2445,7 @@ sn9c102_vidioc_s_crop(struct sn9c102_device* cam, void __user * arg)
                cam->state |= DEV_MISCONFIGURED;
                DBG(1, "VIDIOC_S_CROP failed because of not enough memory. To "
                       "use the camera, close and open /dev/video%d again.",
-                   cam->v4ldev->minor);
+                   cam->v4ldev->num);
                return -ENOMEM;
        }
 
@@ -2689,7 +2689,7 @@ sn9c102_vidioc_try_s_fmt(struct sn9c102_device* cam, unsigned int cmd,
                cam->state |= DEV_MISCONFIGURED;
                DBG(1, "VIDIOC_S_FMT failed because of hardware problems. To "
                       "use the camera, close and open /dev/video%d again.",
-                   cam->v4ldev->minor);
+                   cam->v4ldev->num);
                return -EIO;
        }
 
@@ -2701,7 +2701,7 @@ sn9c102_vidioc_try_s_fmt(struct sn9c102_device* cam, unsigned int cmd,
                cam->state |= DEV_MISCONFIGURED;
                DBG(1, "VIDIOC_S_FMT failed because of not enough memory. To "
                       "use the camera, close and open /dev/video%d again.",
-                   cam->v4ldev->minor);
+                   cam->v4ldev->num);
                return -ENOMEM;
        }
 
@@ -2748,7 +2748,7 @@ sn9c102_vidioc_s_jpegcomp(struct sn9c102_device* cam, void __user * arg)
                cam->state |= DEV_MISCONFIGURED;
                DBG(1, "VIDIOC_S_JPEGCOMP failed because of hardware "
                       "problems. To use the camera, close and open "
-                      "/dev/video%d again.", cam->v4ldev->minor);
+                      "/dev/video%d again.", cam->v4ldev->num);
                return -EIO;
        }
 
@@ -3348,7 +3348,7 @@ sn9c102_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
                goto fail;
        }
 
-       DBG(2, "V4L2 device registered as /dev/video%d", cam->v4ldev->minor);
+       DBG(2, "V4L2 device registered as /dev/video%d", cam->v4ldev->num);
 
        video_set_drvdata(cam->v4ldev, cam);
        cam->module_param.force_munmap = force_munmap[dev_nr];
@@ -3402,7 +3402,7 @@ static void sn9c102_usb_disconnect(struct usb_interface* intf)
        if (cam->users) {
                DBG(2, "Device /dev/video%d is open! Deregistration and "
                       "memory deallocation are deferred.",
-                   cam->v4ldev->minor);
+                   cam->v4ldev->num);
                cam->state |= DEV_MISCONFIGURED;
                sn9c102_stop_transfer(cam);
                cam->state |= DEV_DISCONNECTED;
index edaea4964513ef3027a3673034877ee886d5743d..e9eb6d754d5c85db037e9d41fa398a1e2589830a 100644 (file)
@@ -1331,7 +1331,7 @@ static int stk_register_video_device(struct stk_camera *dev)
                STK_ERROR("v4l registration failed\n");
        else
                STK_INFO("Syntek USB2.0 Camera is now controlling video device"
-                       " /dev/video%d\n", dev->vdev.minor);
+                       " /dev/video%d\n", dev->vdev.num);
        return err;
 }
 
@@ -1426,7 +1426,7 @@ static void stk_camera_disconnect(struct usb_interface *interface)
        stk_remove_sysfs_files(&dev->vdev);
 
        STK_INFO("Syntek USB2.0 Camera release resources "
-               "video device /dev/video%d\n", dev->vdev.minor);
+               "video device /dev/video%d\n", dev->vdev.num);
 
        video_unregister_device(&dev->vdev);
 }
index 9c549d93599426c3d0ad53348b481edeb8decb52..328c41b1517d1a0d0897a17baad51c0fe08c3a40 100644 (file)
@@ -1470,7 +1470,8 @@ static int stv680_probe (struct usb_interface *intf, const struct usb_device_id
                retval = -EIO;
                goto error_vdev;
        }
-       PDEBUG (0, "STV(i): registered new video device: video%d", stv680->vdev->minor);
+       PDEBUG(0, "STV(i): registered new video device: video%d",
+               stv680->vdev->num);
 
        usb_set_intfdata (intf, stv680);
        retval = stv680_create_sysfs_files(stv680->vdev);
index 07cd87d16f69f602dcbd8bf416347200ce79a8d0..7c575bb8184fd6a95c80750f7a3f795afc5f6a24 100644 (file)
@@ -1059,7 +1059,7 @@ int usbvideo_RegisterVideoDevice(struct uvd *uvd)
 
        dev_info(&uvd->dev->dev, "%s on /dev/video%d: canvas=%s videosize=%s\n",
                 (uvd->handle != NULL) ? uvd->handle->drvName : "???",
-                uvd->vdev.minor, tmp2, tmp1);
+                uvd->vdev.num, tmp2, tmp1);
 
        usb_get_dev(uvd->dev);
        return 0;
index 7a127d6bfdee5432770136980b3899afc6f25825..8e2d58bec48120c1991c78fd3f8be963c5095f47 100644 (file)
@@ -877,7 +877,8 @@ vicam_probe( struct usb_interface *intf, const struct usb_device_id *id)
                return -EIO;
        }
 
-       printk(KERN_INFO "ViCam webcam driver now controlling video device %d\n",cam->vdev.minor);
+       printk(KERN_INFO "ViCam webcam driver now controlling video device %d\n",
+                       cam->vdev.num);
 
        usb_set_intfdata (intf, cam);
 
index 92427fdc1459b2b62af94aabe79063a08dc335f3..9907b9aff2b9228bc9aecb92305c7d4418563d8f 100644 (file)
@@ -236,7 +236,7 @@ int usbvision_i2c_register(struct usb_usbvision *usbvision)
               sizeof(struct i2c_client));
 
        sprintf(usbvision->i2c_adap.name + strlen(usbvision->i2c_adap.name),
-               " #%d", usbvision->vdev->minor & 0x1f);
+               " #%d", usbvision->vdev->num);
        PDEBUG(DBG_I2C,"Adaptername: %s", usbvision->i2c_adap.name);
        usbvision->i2c_adap.dev.parent = &usbvision->dev->dev;
 
index 77aeb39b2750b1a34e660e3a733209e89da792af..d185b57fdcd0eb11108f9e2a482c6e869227f24e 100644 (file)
@@ -1440,7 +1440,7 @@ static void usbvision_unregister_video(struct usb_usbvision *usbvision)
        // vbi Device:
        if (usbvision->vbi) {
                PDEBUG(DBG_PROBE, "unregister /dev/vbi%d [v4l2]",
-                      usbvision->vbi->minor & 0x1f);
+                      usbvision->vbi->num);
                if (usbvision->vbi->minor != -1) {
                        video_unregister_device(usbvision->vbi);
                } else {
@@ -1452,7 +1452,7 @@ static void usbvision_unregister_video(struct usb_usbvision *usbvision)
        // Radio Device:
        if (usbvision->rdev) {
                PDEBUG(DBG_PROBE, "unregister /dev/radio%d [v4l2]",
-                      usbvision->rdev->minor & 0x1f);
+                      usbvision->rdev->num);
                if (usbvision->rdev->minor != -1) {
                        video_unregister_device(usbvision->rdev);
                } else {
@@ -1464,7 +1464,7 @@ static void usbvision_unregister_video(struct usb_usbvision *usbvision)
        // Video Device:
        if (usbvision->vdev) {
                PDEBUG(DBG_PROBE, "unregister /dev/video%d [v4l2]",
-                      usbvision->vdev->minor & 0x1f);
+                      usbvision->vdev->num);
                if (usbvision->vdev->minor != -1) {
                        video_unregister_device(usbvision->vdev);
                } else {
@@ -1490,7 +1490,7 @@ static int __devinit usbvision_register_video(struct usb_usbvision *usbvision)
                goto err_exit;
        }
        printk(KERN_INFO "USBVision[%d]: registered USBVision Video device /dev/video%d [v4l2]\n",
-              usbvision->nr,usbvision->vdev->minor & 0x1f);
+              usbvision->nr, usbvision->vdev->num);
 
        // Radio Device:
        if (usbvision_device_data[usbvision->DevModel].Radio) {
@@ -1507,7 +1507,7 @@ static int __devinit usbvision_register_video(struct usb_usbvision *usbvision)
                        goto err_exit;
                }
                printk(KERN_INFO "USBVision[%d]: registered USBVision Radio device /dev/radio%d [v4l2]\n",
-                      usbvision->nr, usbvision->rdev->minor & 0x1f);
+                      usbvision->nr, usbvision->rdev->num);
        }
        // vbi Device:
        if (usbvision_device_data[usbvision->DevModel].vbi) {
@@ -1523,7 +1523,7 @@ static int __devinit usbvision_register_video(struct usb_usbvision *usbvision)
                        goto err_exit;
                }
                printk(KERN_INFO "USBVision[%d]: registered USBVision VBI device /dev/vbi%d [v4l2] (Not Working Yet!)\n",
-                      usbvision->nr,usbvision->vbi->minor & 0x1f);
+                      usbvision->nr, usbvision->vbi->num);
        }
        // all done
        return 0;
index 7d7e51def461b10d11d0efd7968b3fa21b6abb3d..e15e48f04be7511e788b5022f413952d10d93bc7 100644 (file)
@@ -1163,11 +1163,11 @@ static int vivi_release(void)
 
                if (-1 != dev->vfd->minor) {
                        printk(KERN_INFO "%s: unregistering /dev/video%d\n",
-                               VIVI_MODULE_NAME, dev->vfd->minor);
+                               VIVI_MODULE_NAME, dev->vfd->num);
                        video_unregister_device(dev->vfd);
                } else {
                        printk(KERN_INFO "%s: releasing /dev/video%d\n",
-                               VIVI_MODULE_NAME, dev->vfd->minor);
+                               VIVI_MODULE_NAME, dev->vfd->num);
                        video_device_release(dev->vfd);
                }
 
@@ -1307,7 +1307,7 @@ static int __init vivi_init(void)
 
                dev->vfd = vfd;
                printk(KERN_INFO "%s: V4L2 device registered as /dev/video%d\n",
-                       VIVI_MODULE_NAME, vfd->minor);
+                       VIVI_MODULE_NAME, vfd->num);
        }
 
        if (ret < 0) {
index dcd45dbd82dcfa0424b900f78a495d85f5a3ec9e..4dfb43bd1846b977edfe277d6f8e2d06898bb837 100644 (file)
@@ -2398,7 +2398,7 @@ error:
        cam->sensor = CC_UNKNOWN;
        DBG(1, "Image sensor initialization failed for %s (/dev/video%d). "
               "Try to detach and attach this device again",
-           symbolic(camlist, cam->id), cam->v4ldev->minor)
+           symbolic(camlist, cam->id), cam->v4ldev->num)
        return err;
 }
 
@@ -2644,7 +2644,7 @@ static void w9968cf_release_resources(struct w9968cf_device* cam)
 {
        mutex_lock(&w9968cf_devlist_mutex);
 
-       DBG(2, "V4L device deregistered: /dev/video%d", cam->v4ldev->minor)
+       DBG(2, "V4L device deregistered: /dev/video%d", cam->v4ldev->num)
 
        video_unregister_device(cam->v4ldev);
        list_del(&cam->v4llist);
@@ -2679,7 +2679,7 @@ static int w9968cf_open(struct inode* inode, struct file* filp)
                DBG(2, "No supported image sensor has been detected by the "
                       "'ovcamchip' module for the %s (/dev/video%d). Make "
                       "sure it is loaded *before* (re)connecting the camera.",
-                   symbolic(camlist, cam->id), cam->v4ldev->minor)
+                   symbolic(camlist, cam->id), cam->v4ldev->num)
                mutex_unlock(&cam->dev_mutex);
                up_read(&w9968cf_disconnect);
                return -ENODEV;
@@ -2687,7 +2687,7 @@ static int w9968cf_open(struct inode* inode, struct file* filp)
 
        if (cam->users) {
                DBG(2, "%s (/dev/video%d) has been already occupied by '%s'",
-                   symbolic(camlist, cam->id),cam->v4ldev->minor,cam->command)
+                   symbolic(camlist, cam->id), cam->v4ldev->num, cam->command)
                if ((filp->f_flags & O_NONBLOCK)||(filp->f_flags & O_NDELAY)) {
                        mutex_unlock(&cam->dev_mutex);
                        up_read(&w9968cf_disconnect);
@@ -2709,7 +2709,7 @@ static int w9968cf_open(struct inode* inode, struct file* filp)
        }
 
        DBG(5, "Opening '%s', /dev/video%d ...",
-           symbolic(camlist, cam->id), cam->v4ldev->minor)
+           symbolic(camlist, cam->id), cam->v4ldev->num)
 
        cam->streaming = 0;
        cam->misconfigured = 0;
@@ -2947,7 +2947,7 @@ static int w9968cf_v4l_ioctl(struct inode* inode, struct file* filp,
                        .minheight = cam->minheight,
                };
                sprintf(cap.name, "W996[87]CF USB Camera #%d",
-                       cam->v4ldev->minor);
+                       cam->v4ldev->num);
                cap.maxwidth = (cam->upscaling && w9968cf_vpp)
                               ? max((u16)W9968CF_MAX_WIDTH, cam->maxwidth)
                                 : cam->maxwidth;
@@ -3567,7 +3567,7 @@ w9968cf_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
                goto fail;
        }
 
-       DBG(2, "V4L device registered as /dev/video%d", cam->v4ldev->minor)
+       DBG(2, "V4L device registered as /dev/video%d", cam->v4ldev->num)
 
        /* Set some basic constants */
        w9968cf_configure_camera(cam, udev, mod_id, dev_nr);
@@ -3618,7 +3618,7 @@ static void w9968cf_usb_disconnect(struct usb_interface* intf)
                        DBG(2, "The device is open (/dev/video%d)! "
                               "Process name: %s. Deregistration and memory "
                               "deallocation are deferred on close.",
-                           cam->v4ldev->minor, cam->command)
+                           cam->v4ldev->num, cam->command)
                        cam->misconfigured = 1;
                        w9968cf_stop_transfer(cam);
                        wake_up_interruptible(&cam->wait_queue);
index 6a0902bcba6bee88a250b0511cee48269d9c57bf..9fc58170763827d241e50c7deb28a4077941e1c4 100644 (file)
@@ -539,7 +539,7 @@ static int zc0301_stream_interrupt(struct zc0301_device* cam)
                cam->state |= DEV_MISCONFIGURED;
                DBG(1, "URB timeout reached. The camera is misconfigured. To "
                       "use it, close and open /dev/video%d again.",
-                   cam->v4ldev->minor);
+                   cam->v4ldev->num);
                return -EIO;
        }
 
@@ -640,7 +640,7 @@ static void zc0301_release_resources(struct kref *kref)
 {
        struct zc0301_device *cam = container_of(kref, struct zc0301_device,
                                                 kref);
-       DBG(2, "V4L2 device /dev/video%d deregistered", cam->v4ldev->minor);
+       DBG(2, "V4L2 device /dev/video%d deregistered", cam->v4ldev->num);
        video_set_drvdata(cam->v4ldev, NULL);
        video_unregister_device(cam->v4ldev);
        usb_put_dev(cam->usbdev);
@@ -679,7 +679,7 @@ static int zc0301_open(struct inode* inode, struct file* filp)
        }
 
        if (cam->users) {
-               DBG(2, "Device /dev/video%d is busy...", cam->v4ldev->minor);
+               DBG(2, "Device /dev/video%d is busy...", cam->v4ldev->num);
                DBG(3, "Simultaneous opens are not supported");
                if ((filp->f_flags & O_NONBLOCK) ||
                    (filp->f_flags & O_NDELAY)) {
@@ -722,7 +722,7 @@ static int zc0301_open(struct inode* inode, struct file* filp)
        cam->frame_count = 0;
        zc0301_empty_framequeues(cam);
 
-       DBG(3, "Video device /dev/video%d is open", cam->v4ldev->minor);
+       DBG(3, "Video device /dev/video%d is open", cam->v4ldev->num);
 
 out:
        mutex_unlock(&cam->open_mutex);
@@ -746,7 +746,7 @@ static int zc0301_release(struct inode* inode, struct file* filp)
        cam->users--;
        wake_up_interruptible_nr(&cam->wait_open, 1);
 
-       DBG(3, "Video device /dev/video%d closed", cam->v4ldev->minor);
+       DBG(3, "Video device /dev/video%d closed", cam->v4ldev->num);
 
        kref_put(&cam->kref, zc0301_release_resources);
 
@@ -1275,7 +1275,7 @@ zc0301_vidioc_s_crop(struct zc0301_device* cam, void __user * arg)
                cam->state |= DEV_MISCONFIGURED;
                DBG(1, "VIDIOC_S_CROP failed because of hardware problems. To "
                       "use the camera, close and open /dev/video%d again.",
-                   cam->v4ldev->minor);
+                   cam->v4ldev->num);
                return -EIO;
        }
 
@@ -1288,7 +1288,7 @@ zc0301_vidioc_s_crop(struct zc0301_device* cam, void __user * arg)
                cam->state |= DEV_MISCONFIGURED;
                DBG(1, "VIDIOC_S_CROP failed because of not enough memory. To "
                       "use the camera, close and open /dev/video%d again.",
-                   cam->v4ldev->minor);
+                   cam->v4ldev->num);
                return -ENOMEM;
        }
 
@@ -1470,7 +1470,7 @@ zc0301_vidioc_try_s_fmt(struct zc0301_device* cam, unsigned int cmd,
                cam->state |= DEV_MISCONFIGURED;
                DBG(1, "VIDIOC_S_FMT failed because of hardware problems. To "
                       "use the camera, close and open /dev/video%d again.",
-                   cam->v4ldev->minor);
+                   cam->v4ldev->num);
                return -EIO;
        }
 
@@ -1482,7 +1482,7 @@ zc0301_vidioc_try_s_fmt(struct zc0301_device* cam, unsigned int cmd,
                cam->state |= DEV_MISCONFIGURED;
                DBG(1, "VIDIOC_S_FMT failed because of not enough memory. To "
                       "use the camera, close and open /dev/video%d again.",
-                   cam->v4ldev->minor);
+                   cam->v4ldev->num);
                return -ENOMEM;
        }
 
@@ -1529,7 +1529,7 @@ zc0301_vidioc_s_jpegcomp(struct zc0301_device* cam, void __user * arg)
                cam->state |= DEV_MISCONFIGURED;
                DBG(1, "VIDIOC_S_JPEGCOMP failed because of hardware "
                       "problems. To use the camera, close and open "
-                      "/dev/video%d again.", cam->v4ldev->minor);
+                      "/dev/video%d again.", cam->v4ldev->num);
                return -EIO;
        }
 
@@ -2005,7 +2005,7 @@ zc0301_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
                goto fail;
        }
 
-       DBG(2, "V4L2 device registered as /dev/video%d", cam->v4ldev->minor);
+       DBG(2, "V4L2 device registered as /dev/video%d", cam->v4ldev->num);
 
        cam->module_param.force_munmap = force_munmap[dev_nr];
        cam->module_param.frame_timeout = frame_timeout[dev_nr];
@@ -2044,7 +2044,7 @@ static void zc0301_usb_disconnect(struct usb_interface* intf)
        if (cam->users) {
                DBG(2, "Device /dev/video%d is open! Deregistration and "
                       "memory deallocation are deferred.",
-                   cam->v4ldev->minor);
+                   cam->v4ldev->num);
                cam->state |= DEV_MISCONFIGURED;
                zc0301_stop_transfer(cam);
                cam->state |= DEV_DISCONNECTED;
index 7cdac99deea69fe909b0a03e5be6e25459e54b12..a1d81ed44c7c965451ae5acb00727dc079305c5f 100644 (file)
@@ -885,7 +885,7 @@ static int zr364xx_probe(struct usb_interface *intf,
        usb_set_intfdata(intf, cam);
 
        dev_info(&udev->dev, DRIVER_DESC " controlling video device %d\n",
-                cam->vdev->minor);
+                cam->vdev->num);
        return 0;
 }