V4L/DVB (13550): v4l: Use the new video_device_node_name function
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Fri, 27 Nov 2009 16:57:15 +0000 (13:57 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 16 Dec 2009 02:17:55 +0000 (00:17 -0200)
Fix all device drivers to use the new video_device_node_name function.

This also strips kernel log messages from the "/dev/" prefix, has the device
node location is a userspace policy decision unknown to the kernel.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
37 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/cpia.c
drivers/media/video/cpia2/cpia2_v4l.c
drivers/media/video/cx18/cx18-streams.c
drivers/media/video/cx231xx/cx231xx-cards.c
drivers/media/video/cx231xx/cx231xx-video.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-cards.c
drivers/media/video/em28xx/em28xx-video.c
drivers/media/video/et61x251/et61x251_core.c
drivers/media/video/gspca/gl860/gl860.c
drivers/media/video/gspca/gspca.c
drivers/media/video/hdpvr/hdpvr-core.c
drivers/media/video/ivtv/ivtv-streams.c
drivers/media/video/omap24xxcam.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-video.c
drivers/media/video/vivi.c
drivers/media/video/w9968cf.c
drivers/media/video/zc0301/zc0301_core.c
drivers/media/video/zr364xx.c
drivers/staging/go7007/go7007-v4l2.c

index 620f655fa9c5b1e2602755fff2dadf9f7689000b..f279a64404155f91fdbf76fbb91311023746e4a8 100644 (file)
@@ -543,15 +543,13 @@ int saa7146_register_device(struct video_device **vid, struct saa7146_dev* dev,
                return err;
        }
 
-       if( VFL_TYPE_GRABBER == type ) {
+       if (VFL_TYPE_GRABBER == type)
                vv->video_minor = vfd->minor;
-               INFO(("%s: registered device video%d [v4l2]\n",
-                       dev->name, vfd->num));
-       } else {
+       else
                vv->vbi_minor = vfd->minor;
-               INFO(("%s: registered device vbi%d [v4l2]\n",
-                       dev->name, vfd->num));
-       }
+
+       INFO(("%s: registered device %s [v4l2]\n",
+               dev->name, video_device_node_name(vfd)));
 
        *vid = vfd;
        return 0;
index d137bac84511eb9c3dfdb7c61aef5140a163ec5a..0ec807d82795ec2a7a3bda792c316bfabea04806 100644 (file)
@@ -860,8 +860,8 @@ static int __init ar_init(void)
                goto out_dev;
        }
 
-       printk("video%d: Found M64278 VGA (IRQ %d, Freq %dMHz).\n",
-               ar->vdev->num, M32R_IRQ_INT3, freq);
+       printk("%s: Found M64278 VGA (IRQ %d, Freq %dMHz).\n",
+               video_device_node_name(ar->vdev), M32R_IRQ_INT3, freq);
 
        return 0;
 
index a6724019c66f5d9d121edd285a89e73772e7e350..d57618319896e6284304aed26e5146431e8d8bda 100644 (file)
@@ -4244,8 +4244,8 @@ static int __devinit bttv_register_video(struct bttv *btv)
        if (video_register_device(btv->video_dev, VFL_TYPE_GRABBER,
                                  video_nr[btv->c.nr]) < 0)
                goto err;
-       printk(KERN_INFO "bttv%d: registered device video%d\n",
-              btv->c.nr, btv->video_dev->num);
+       printk(KERN_INFO "bttv%d: registered device %s\n",
+              btv->c.nr, video_device_node_name(btv->video_dev));
        if (device_create_file(&btv->video_dev->dev,
                                     &dev_attr_card)<0) {
                printk(KERN_ERR "bttv%d: device_create_file 'card' "
@@ -4261,8 +4261,8 @@ static int __devinit bttv_register_video(struct bttv *btv)
        if (video_register_device(btv->vbi_dev, VFL_TYPE_VBI,
                                  vbi_nr[btv->c.nr]) < 0)
                goto err;
-       printk(KERN_INFO "bttv%d: registered device vbi%d\n",
-              btv->c.nr, btv->vbi_dev->num);
+       printk(KERN_INFO "bttv%d: registered device %s\n",
+              btv->c.nr, video_device_node_name(btv->vbi_dev));
 
        if (!btv->has_radio)
                return 0;
@@ -4273,8 +4273,8 @@ static int __devinit bttv_register_video(struct bttv *btv)
        if (video_register_device(btv->radio_dev, VFL_TYPE_RADIO,
                                  radio_nr[btv->c.nr]) < 0)
                goto err;
-       printk(KERN_INFO "bttv%d: registered device radio%d\n",
-              btv->c.nr, btv->radio_dev->num);
+       printk(KERN_INFO "bttv%d: registered device %s\n",
+              btv->c.nr, video_device_node_name(btv->radio_dev));
 
        /* all done */
        return 0;
index 85cf1778827adee718ba6ad930bfec12d37be25d..e2cbebab959bdffffb51a8347cfaf86db14d45f5 100644 (file)
@@ -809,8 +809,8 @@ static int init_cqcam(struct parport *port)
                return -ENODEV;
        }
 
-       printk(KERN_INFO "video%d: Colour QuickCam found on %s\n",
-              qcam->vdev.num, qcam->pport->name);
+       printk(KERN_INFO "%s: Colour QuickCam found on %s\n",
+              video_device_node_name(&qcam->vdev), qcam->pport->name);
 
        qcams[num_cams++] = qcam;
 
index 2377313c041a8c33976db18f0c1ef7a698c94bd6..d6f2653afb6cc05048af79e674ebfcf6c6420958 100644 (file)
@@ -1342,15 +1342,13 @@ out:
 
 static void create_proc_cpia_cam(struct cam_data *cam)
 {
-       char name[5 + 1 + 10 + 1];
        struct proc_dir_entry *ent;
 
        if (!cpia_proc_root || !cam)
                return;
 
-       snprintf(name, sizeof(name), "video%d", cam->vdev.num);
-
-       ent = create_proc_entry(name, S_IFREG|S_IRUGO|S_IWUSR, cpia_proc_root);
+       ent = create_proc_entry(video_device_node_name(&cam->vdev),
+                               S_IFREG|S_IRUGO|S_IWUSR, cpia_proc_root);
        if (!ent)
                return;
 
@@ -1368,13 +1366,10 @@ static void create_proc_cpia_cam(struct cam_data *cam)
 
 static void destroy_proc_cpia_cam(struct cam_data *cam)
 {
-       char name[5 + 1 + 10 + 1];
-
        if (!cam || !cam->proc_entry)
                return;
 
-       snprintf(name, sizeof(name), "video%d", cam->vdev.num);
-       remove_proc_entry(name, cpia_proc_root);
+       remove_proc_entry(video_device_node_name(&cam->vdev), cpia_proc_root);
        cam->proc_entry = NULL;
 }
 
@@ -3999,7 +3994,7 @@ void cpia_unregister_camera(struct cam_data *cam)
        }
 
 #ifdef CONFIG_PROC_FS
-       DBG("destroying /proc/cpia/video%d\n", cam->vdev.num);
+       DBG("destroying /proc/cpia/%s\n", video_device_node_name(&cam->vdev));
        destroy_proc_cpia_cam(cam);
 #endif
        if (!cam->open_count) {
index 0b4a8f309cfab14c65727e378cc6d352b3bea881..f8952af30a3c647871af8b073356d4ae30d251b6 100644 (file)
@@ -1967,9 +1967,9 @@ void cpia2_unregister_camera(struct camera_data *cam)
        if (!cam->open_count) {
                video_unregister_device(cam->vdev);
        } else {
-               LOG("/dev/video%d removed while open, "
-                   "deferring video_unregister_device\n",
-                   cam->vdev->num);
+               LOG("%s removed while open, deferring "
+                   "video_unregister_device\n",
+                   video_device_node_name(cam->vdev));
        }
 }
 
index c398651dd74c861a9254bf9d6a60f4c4f4f680ec..987a9308d938523dab6914ddc647bd3ee4364b3b 100644 (file)
@@ -219,6 +219,7 @@ static int cx18_reg_dev(struct cx18 *cx, int type)
 {
        struct cx18_stream *s = &cx->streams[type];
        int vfl_type = cx18_stream_info[type].vfl_type;
+       const char *name;
        int num, ret;
 
        /* TODO: Shouldn't this be a VFL_TYPE_TRANSPORT or something?
@@ -258,31 +259,30 @@ static int cx18_reg_dev(struct cx18 *cx, int type)
                s->video_dev = NULL;
                return ret;
        }
-       num = s->video_dev->num;
+
+       name = video_device_node_name(s->video_dev);
 
        switch (vfl_type) {
        case VFL_TYPE_GRABBER:
-               CX18_INFO("Registered device video%d for %s "
-                         "(%d x %d.%02d kB)\n",
-                         num, s->name, cx->stream_buffers[type],
+               CX18_INFO("Registered device %s for %s (%d x %d.%02d kB)\n",
+                         name, s->name, cx->stream_buffers[type],
                          cx->stream_buf_size[type] / 1024,
                          (cx->stream_buf_size[type] * 100 / 1024) % 100);
                break;
 
        case VFL_TYPE_RADIO:
-               CX18_INFO("Registered device radio%d for %s\n",
-                       num, s->name);
+               CX18_INFO("Registered device %s for %s\n", name, s->name);
                break;
 
        case VFL_TYPE_VBI:
                if (cx->stream_buffers[type])
-                       CX18_INFO("Registered device vbi%d for %s "
+                       CX18_INFO("Registered device %s for %s "
                                  "(%d x %d bytes)\n",
-                                 num, s->name, cx->stream_buffers[type],
+                                 name, s->name, cx->stream_buffers[type],
                                  cx->stream_buf_size[type]);
                else
-                       CX18_INFO("Registered device vbi%d for %s\n",
-                               num, s->name);
+                       CX18_INFO("Registered device %s for %s\n",
+                               name, s->name);
                break;
        }
 
index 319c459459e0c5a0fb0f3323d0780b59a8ec65c6..ff534fe7f4a378b1a0ffdd08d343ba76e76306b1 100644 (file)
@@ -856,8 +856,9 @@ static void cx231xx_usb_disconnect(struct usb_interface *interface)
 
        if (dev->users) {
                cx231xx_warn
-                   ("device /dev/video%d is open! Deregistration and memory "
-                    "deallocation are deferred on close.\n", dev->vdev->num);
+                   ("device %s is open! Deregistration and memory "
+                    "deallocation are deferred on close.\n",
+                    video_device_node_name(dev->vdev));
 
                dev->state |= DEV_MISCONFIGURED;
                cx231xx_uninit_isoc(dev);
index d095aa0d6d19f517cbeb3c4716d8b40438544d3a..1c7f84e203e692cb0e0a144d8d52bfd4e2bd94d4 100644 (file)
@@ -2027,8 +2027,8 @@ void cx231xx_release_analog_resources(struct cx231xx *dev)
                dev->radio_dev = NULL;
        }
        if (dev->vbi_dev) {
-               cx231xx_info("V4L2 device /dev/vbi%d deregistered\n",
-                            dev->vbi_dev->num);
+               cx231xx_info("V4L2 device %s deregistered\n",
+                            video_device_node_name(dev->vbi_dev));
                if (-1 != dev->vbi_dev->minor)
                        video_unregister_device(dev->vbi_dev);
                else
@@ -2036,8 +2036,8 @@ void cx231xx_release_analog_resources(struct cx231xx *dev)
                dev->vbi_dev = NULL;
        }
        if (dev->vdev) {
-               cx231xx_info("V4L2 device /dev/video%d deregistered\n",
-                            dev->vdev->num);
+               cx231xx_info("V4L2 device %s deregistered\n",
+                            video_device_node_name(dev->vdev));
                if (-1 != dev->vdev->minor)
                        video_unregister_device(dev->vdev);
                else
@@ -2374,8 +2374,8 @@ int cx231xx_register_analog_devices(struct cx231xx *dev)
                return ret;
        }
 
-       cx231xx_info("%s/0: registered device video%d [v4l2]\n",
-                    dev->name, dev->vdev->num);
+       cx231xx_info("%s/0: registered device %s [v4l2]\n",
+                    dev->name, video_device_node_name(dev->vdev));
 
        /* Initialize VBI template */
        memcpy(&cx231xx_vbi_template, &cx231xx_video_template,
@@ -2393,8 +2393,8 @@ int cx231xx_register_analog_devices(struct cx231xx *dev)
                return ret;
        }
 
-       cx231xx_info("%s/0: registered device vbi%d\n",
-                    dev->name, dev->vbi_dev->num);
+       cx231xx_info("%s/0: registered device %s\n",
+                    dev->name, video_device_node_name(dev->vbi_dev));
 
        if (cx231xx_boards[dev->model].radio.type == CX231XX_RADIO) {
                dev->radio_dev = cx231xx_vdev_init(dev, &cx231xx_radio_template,
@@ -2409,12 +2409,13 @@ int cx231xx_register_analog_devices(struct cx231xx *dev)
                        cx231xx_errdev("can't register radio device\n");
                        return ret;
                }
-               cx231xx_info("Registered radio device as /dev/radio%d\n",
-                            dev->radio_dev->num);
+               cx231xx_info("Registered radio device as %s\n",
+                            video_device_node_name(dev->radio_dev));
        }
 
-       cx231xx_info("V4L2 device registered as /dev/video%d and /dev/vbi%d\n",
-                    dev->vdev->num, dev->vbi_dev->num);
+       cx231xx_info("V4L2 device registered as %s and %s\n",
+                    video_device_node_name(dev->vdev),
+                    video_device_node_name(dev->vbi_dev));
 
        return 0;
 }
index 0eed852c61e9c9324b861796d76fcc2ad5ffa78c..8084e13dd103bdd6026b43b2f5b74acc0fb6e006 100644 (file)
@@ -1810,8 +1810,8 @@ int cx23885_417_register(struct cx23885_dev *dev)
                return err;
        }
 
-       printk(KERN_INFO "%s: registered device video%d [mpeg]\n",
-              dev->name, dev->v4l_device->num);
+       printk(KERN_INFO "%s: registered device %s [mpeg]\n",
+              dev->name, video_device_node_name(dev->v4l_device));
 
        return 0;
 }
index 8b372b4f0de251fc8cb8244eced68833cae26dac..5570383fa332fba54f6252ef892eb1ab79c0c50f 100644 (file)
@@ -1532,8 +1532,8 @@ int cx23885_video_register(struct cx23885_dev *dev)
                        dev->name);
                goto fail_unreg;
        }
-       printk(KERN_INFO "%s/0: registered device video%d [v4l2]\n",
-              dev->name, dev->video_dev->num);
+       printk(KERN_INFO "%s/0: registered device %s [v4l2]\n",
+              dev->name, video_device_node_name(dev->video_dev));
        /* initial device configuration */
        mutex_lock(&dev->lock);
        cx23885_set_tvnorm(dev, dev->tvnorm);
index fbdc1cde56a6b1597cbac7f37d5f44b9677529b0..9f02715b4e153858d5a2b3eebc69c329da79547b 100644 (file)
@@ -1296,8 +1296,8 @@ static int blackbird_register_video(struct cx8802_dev *dev)
                       dev->core->name);
                return err;
        }
-       printk(KERN_INFO "%s/2: registered device video%d [mpeg]\n",
-              dev->core->name, dev->mpeg_dev->num);
+       printk(KERN_INFO "%s/2: registered device %s [mpeg]\n",
+              dev->core->name, video_device_node_name(dev->mpeg_dev));
        return 0;
 }
 
index d7e8fcee559c04c4ff5d36a7840e6236924dd045..55063a76a43a7d07fff6f4aa5b1ede0c75181188 100644 (file)
@@ -1916,8 +1916,8 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
                       core->name);
                goto fail_unreg;
        }
-       printk(KERN_INFO "%s/0: registered device video%d [v4l2]\n",
-              core->name, dev->video_dev->num);
+       printk(KERN_INFO "%s/0: registered device %s [v4l2]\n",
+              core->name, video_device_node_name(dev->video_dev));
 
        dev->vbi_dev = cx88_vdev_init(core,dev->pci,&cx8800_vbi_template,"vbi");
        err = video_register_device(dev->vbi_dev,VFL_TYPE_VBI,
@@ -1927,8 +1927,8 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
                       core->name);
                goto fail_unreg;
        }
-       printk(KERN_INFO "%s/0: registered device vbi%d\n",
-              core->name, dev->vbi_dev->num);
+       printk(KERN_INFO "%s/0: registered device %s\n",
+              core->name, video_device_node_name(dev->vbi_dev));
 
        if (core->board.radio.type == CX88_RADIO) {
                dev->radio_dev = cx88_vdev_init(core,dev->pci,
@@ -1940,8 +1940,8 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
                               core->name);
                        goto fail_unreg;
                }
-               printk(KERN_INFO "%s/0: registered device radio%d\n",
-                      core->name, dev->radio_dev->num);
+               printk(KERN_INFO "%s/0: registered device %s\n",
+                      core->name, video_device_node_name(dev->radio_dev));
        }
 
        /* everything worked */
index 82da205047befb219b7c6f945a6c44af222d93ed..4ace70946d3212aec5d31855f5a28605286fb7ac 100644 (file)
@@ -2923,9 +2923,9 @@ static void em28xx_usb_disconnect(struct usb_interface *interface)
 
        if (dev->users) {
                em28xx_warn
-                   ("device /dev/video%d is open! Deregistration and memory "
+                   ("device %s is open! Deregistration and memory "
                     "deallocation are deferred on close.\n",
-                               dev->vdev->num);
+                    video_device_node_name(dev->vdev));
 
                dev->state |= DEV_MISCONFIGURED;
                em28xx_uninit_isoc(dev);
index 7ad65370f274a24a8cfb2028af2c41d449794f27..5cc4fff04cdbf1b8e37f104251f2c1ca0d87a453 100644 (file)
@@ -2167,8 +2167,8 @@ void em28xx_release_analog_resources(struct em28xx *dev)
                dev->radio_dev = NULL;
        }
        if (dev->vbi_dev) {
-               em28xx_info("V4L2 device /dev/vbi%d deregistered\n",
-                           dev->vbi_dev->num);
+               em28xx_info("V4L2 device %s deregistered\n",
+                           video_device_node_name(dev->vbi_dev));
                if (-1 != dev->vbi_dev->minor)
                        video_unregister_device(dev->vbi_dev);
                else
@@ -2176,8 +2176,8 @@ void em28xx_release_analog_resources(struct em28xx *dev)
                dev->vbi_dev = NULL;
        }
        if (dev->vdev) {
-               em28xx_info("V4L2 device /dev/video%d deregistered\n",
-                           dev->vdev->num);
+               em28xx_info("V4L2 device %s deregistered\n",
+                           video_device_node_name(dev->vdev));
                if (-1 != dev->vdev->minor)
                        video_unregister_device(dev->vdev);
                else
@@ -2540,16 +2540,16 @@ int em28xx_register_analog_devices(struct em28xx *dev)
                        em28xx_errdev("can't register radio device\n");
                        return ret;
                }
-               em28xx_info("Registered radio device as /dev/radio%d\n",
-                           dev->radio_dev->num);
+               em28xx_info("Registered radio device as %s\n",
+                           video_device_node_name(dev->radio_dev));
        }
 
-       em28xx_info("V4L2 video device registered as /dev/video%d\n",
-                               dev->vdev->num);
+       em28xx_info("V4L2 video device registered as %s\n",
+                   video_device_node_name(dev->vdev));
 
        if (dev->vbi_dev)
-               em28xx_info("V4L2 VBI device registered as /dev/vbi%d\n",
-                           dev->vbi_dev->num);
+               em28xx_info("V4L2 VBI device registered as %s\n",
+                           video_device_node_name(dev->vbi_dev));
 
        return 0;
 }
index 88987a57cf7b655e820517a32fd35f67fe83c1d1..f561a1c8679125fd28bdde90db1e5ee2a0710152 100644 (file)
@@ -587,8 +587,8 @@ static int et61x251_stream_interrupt(struct et61x251_device* cam)
        else if (cam->stream != STREAM_OFF) {
                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->num);
+                      "use it, close and open %s again.",
+                   video_device_node_name(cam->v4ldev));
                return -EIO;
        }
 
@@ -1195,7 +1195,8 @@ 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->num);
+       DBG(2, "V4L2 device %s deregistered",
+           video_device_node_name(cam->v4ldev));
        video_set_drvdata(cam->v4ldev, NULL);
        video_unregister_device(cam->v4ldev);
        usb_put_dev(cam->usbdev);
@@ -1236,8 +1237,8 @@ static int et61x251_open(struct file *filp)
        }
 
        if (cam->users) {
-               DBG(2, "Device /dev/video%d is already in use",
-                      cam->v4ldev->num);
+               DBG(2, "Device %s is already in use",
+                      video_device_node_name(cam->v4ldev));
                DBG(3, "Simultaneous opens are not supported");
                if ((filp->f_flags & O_NONBLOCK) ||
                    (filp->f_flags & O_NDELAY)) {
@@ -1280,7 +1281,8 @@ static int et61x251_open(struct file *filp)
        cam->frame_count = 0;
        et61x251_empty_framequeues(cam);
 
-       DBG(3, "Video device /dev/video%d is open", cam->v4ldev->num);
+       DBG(3, "Video device %s is open",
+           video_device_node_name(cam->v4ldev));
 
 out:
        mutex_unlock(&cam->open_mutex);
@@ -1304,7 +1306,8 @@ static int et61x251_release(struct file *filp)
        cam->users--;
        wake_up_interruptible_nr(&cam->wait_open, 1);
 
-       DBG(3, "Video device /dev/video%d closed", cam->v4ldev->num);
+       DBG(3, "Video device %s closed",
+           video_device_node_name(cam->v4ldev));
 
        kref_put(&cam->kref, et61x251_release_resources);
 
@@ -1846,8 +1849,8 @@ et61x251_vidioc_s_crop(struct et61x251_device* cam, void __user * arg)
        if (err) { /* atomic, no rollback in ioctl() */
                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->num);
+                      "use the camera, close and open %s again.",
+                   video_device_node_name(cam->v4ldev));
                return -EIO;
        }
 
@@ -1859,8 +1862,8 @@ et61x251_vidioc_s_crop(struct et61x251_device* cam, void __user * arg)
            nbuffers != et61x251_request_buffers(cam, nbuffers, cam->io)) {
                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->num);
+                      "use the camera, close and open %s again.",
+                   video_device_node_name(cam->v4ldev));
                return -ENOMEM;
        }
 
@@ -2069,8 +2072,8 @@ et61x251_vidioc_try_s_fmt(struct et61x251_device* cam, unsigned int cmd,
        if (err) { /* atomic, no rollback in ioctl() */
                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->num);
+                      "use the camera, close and open %s again.",
+                   video_device_node_name(cam->v4ldev));
                return -EIO;
        }
 
@@ -2081,8 +2084,8 @@ et61x251_vidioc_try_s_fmt(struct et61x251_device* cam, unsigned int cmd,
            nbuffers != et61x251_request_buffers(cam, nbuffers, cam->io)) {
                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->num);
+                      "use the camera, close and open %s again.",
+                   video_device_node_name(cam->v4ldev));
                return -ENOMEM;
        }
 
@@ -2130,7 +2133,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->num);
+                      "%s again.", video_device_node_name(cam->v4ldev));
                return -EIO;
        }
 
@@ -2603,7 +2606,8 @@ 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->num);
+       DBG(2, "V4L2 device registered as %s",
+           video_device_node_name(cam->v4ldev));
 
        cam->module_param.force_munmap = force_munmap[dev_nr];
        cam->module_param.frame_timeout = frame_timeout[dev_nr];
@@ -2654,9 +2658,9 @@ static void et61x251_usb_disconnect(struct usb_interface* intf)
        DBG(2, "Disconnecting %s...", cam->v4ldev->name);
 
        if (cam->users) {
-               DBG(2, "Device /dev/video%d is open! Deregistration and "
-                      "memory deallocation are deferred.",
-                   cam->v4ldev->num);
+               DBG(2, "Device %s is open! Deregistration and memory "
+                      "deallocation are deferred.",
+                   video_device_node_name(cam->v4ldev));
                cam->state |= DEV_MISCONFIGURED;
                et61x251_stop_transfer(cam);
                cam->state |= DEV_DISCONNECTED;
index a695e0ae13c2c40e44b8b4f8e181d2cc07d1c680..bd3c21a37be68b5698de6aeae26c8ec9358880f4 100644 (file)
@@ -534,8 +534,8 @@ static int sd_probe(struct usb_interface *intf,
                gspca_dev = usb_get_intfdata(intf);
 
                PDEBUG(D_PROBE,
-                       "Camera is now controlling video device /dev/video%d",
-                       gspca_dev->vdev.minor);
+                       "Camera is now controlling video device %s",
+                       video_device_node_name(&gspca_dev->vdev));
        }
 
        return ret;
index 4076f8e5a6fc44b5cd556b9cc519ae2dd07edde5..6af4f233bf5287ea94a65e9af882640204722b0b 100644 (file)
@@ -987,7 +987,8 @@ static void gspca_release(struct video_device *vfd)
 {
        struct gspca_dev *gspca_dev = container_of(vfd, struct gspca_dev, vdev);
 
-       PDEBUG(D_PROBE, "/dev/video%d released", gspca_dev->vdev.num);
+       PDEBUG(D_PROBE, "%s released",
+               video_device_node_name(&gspca_dev->vdev));
 
        kfree(gspca_dev->usb_buf);
        kfree(gspca_dev);
@@ -2073,7 +2074,7 @@ int gspca_dev_probe(struct usb_interface *intf,
        }
 
        usb_set_intfdata(intf, gspca_dev);
-       PDEBUG(D_PROBE, "/dev/video%d created", gspca_dev->vdev.num);
+       PDEBUG(D_PROBE, "%s created", video_device_node_name(&gspca_dev->vdev));
        return 0;
 out:
        kfree(gspca_dev->usb_buf);
@@ -2092,7 +2093,8 @@ void gspca_disconnect(struct usb_interface *intf)
 {
        struct gspca_dev *gspca_dev = usb_get_intfdata(intf);
 
-       PDEBUG(D_PROBE, "/dev/video%d disconnect", gspca_dev->vdev.num);
+       PDEBUG(D_PROBE, "%s disconnect",
+               video_device_node_name(&gspca_dev->vdev));
        mutex_lock(&gspca_dev->usb_lock);
        gspca_dev->present = 0;
 
index 1c9bc94c905c0afb29f460c7b044fde1175cc8c6..e280eb178fe9ffe648c0285a996b73e96effad39 100644 (file)
@@ -376,8 +376,8 @@ static int hdpvr_probe(struct usb_interface *interface,
        usb_set_intfdata(interface, dev);
 
        /* let the user know what node this device is now attached to */
-       v4l2_info(&dev->v4l2_dev, "device now attached to /dev/video%d\n",
-                 dev->video_dev->minor);
+       v4l2_info(&dev->v4l2_dev, "device now attached to %s\n",
+                 video_device_node_name(dev->video_dev));
        return 0;
 
 error:
@@ -391,13 +391,10 @@ error:
 static void hdpvr_disconnect(struct usb_interface *interface)
 {
        struct hdpvr_device *dev;
-       int minor;
 
        dev = usb_get_intfdata(interface);
        usb_set_intfdata(interface, NULL);
 
-       minor = dev->video_dev->minor;
-
        /* prevent more I/O from starting and stop any ongoing */
        mutex_lock(&dev->io_mutex);
        dev->status = STATUS_DISCONNECTED;
@@ -425,7 +422,8 @@ static void hdpvr_disconnect(struct usb_interface *interface)
 
        atomic_dec(&dev_nr);
 
-       v4l2_info(&dev->v4l2_dev, "device /dev/video%d disconnected\n", minor);
+       v4l2_info(&dev->v4l2_dev, "device %s disconnected\n",
+                 video_device_node_name(dev->video_dev));
 
        v4l2_device_unregister(&dev->v4l2_dev);
        kfree(dev->usbc_buf);
index 67699e3f2aaa07346e142c4dd5eeb6fc9a918b1b..e12c6022373e38afaaf0ad3b559f3184b67456f9 100644 (file)
@@ -245,6 +245,7 @@ static int ivtv_reg_dev(struct ivtv *itv, int type)
 {
        struct ivtv_stream *s = &itv->streams[type];
        int vfl_type = ivtv_stream_info[type].vfl_type;
+       const char *name;
        int num;
 
        if (s->vdev == NULL)
@@ -268,24 +269,24 @@ static int ivtv_reg_dev(struct ivtv *itv, int type)
                s->vdev = NULL;
                return -ENOMEM;
        }
-       num = s->vdev->num;
+       name = video_device_node_name(s->vdev);
 
        switch (vfl_type) {
        case VFL_TYPE_GRABBER:
-               IVTV_INFO("Registered device video%d for %s (%d kB)\n",
-                       num, s->name, itv->options.kilobytes[type]);
+               IVTV_INFO("Registered device %s for %s (%d kB)\n",
+                       name, s->name, itv->options.kilobytes[type]);
                break;
        case VFL_TYPE_RADIO:
-               IVTV_INFO("Registered device radio%d for %s\n",
-                       num, s->name);
+               IVTV_INFO("Registered device %s for %s\n",
+                       name, s->name);
                break;
        case VFL_TYPE_VBI:
                if (itv->options.kilobytes[type])
-                       IVTV_INFO("Registered device vbi%d for %s (%d kB)\n",
-                               num, s->name, itv->options.kilobytes[type]);
+                       IVTV_INFO("Registered device %s for %s (%d kB)\n",
+                               name, s->name, itv->options.kilobytes[type]);
                else
-                       IVTV_INFO("Registered device vbi%d for %s\n",
-                               num, s->name);
+                       IVTV_INFO("Registered device %s for %s\n",
+                               name, s->name);
                break;
        }
        return 0;
index 5fc4ac0d88f042beb8e4cddf8a8180f90a777266..e2f137b0daeb8cc51c8c56f36a9c7fddf49e75a5 100644 (file)
@@ -1678,7 +1678,8 @@ static int omap24xxcam_device_register(struct v4l2_int_device *s)
 
        omap24xxcam_poweron_reset(cam);
 
-       dev_info(cam->dev, "registered device video%d\n", vfd->minor);
+       dev_info(cam->dev, "registered device %s\n",
+                video_device_node_name(vfd));
 
        return 0;
 
index 6aa48e0ae7312cb0324844099175bc8dc001fc9e..cc8ddb2d2382902bb8e67194e3b79dfeaad0a65c 100644 (file)
@@ -151,17 +151,6 @@ static struct v4l2_format pvr_format [] = {
 };
 
 
-static const char *get_v4l_name(int v4l_type)
-{
-       switch (v4l_type) {
-       case VFL_TYPE_GRABBER: return "video";
-       case VFL_TYPE_RADIO: return "radio";
-       case VFL_TYPE_VBI: return "vbi";
-       default: return "?";
-       }
-}
-
-
 /*
  * pvr_ioctl()
  *
@@ -891,10 +880,8 @@ static long pvr2_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
 
 static void pvr2_v4l2_dev_destroy(struct pvr2_v4l2_dev *dip)
 {
-       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;
 
        pvr2_hdw_v4l_store_minor_number(hdw,dip->minor_type,-1);
 
@@ -906,8 +893,8 @@ static void pvr2_v4l2_dev_destroy(struct pvr2_v4l2_dev *dip)
           are gone. */
        video_unregister_device(&dip->devbase);
 
-       printk(KERN_INFO "pvrusb2: unregistered device %s%u [%s]\n",
-              get_v4l_name(v4l_type), num,
+       printk(KERN_INFO "pvrusb2: unregistered device %s [%s]\n",
+              video_device_node_name(&dip->devbase),
               pvr2_config_get_name(cfg));
 
 }
@@ -1317,8 +1304,8 @@ static void pvr2_v4l2_dev_init(struct pvr2_v4l2_dev *dip,
                        ": Failed to register pvrusb2 v4l device\n");
        }
 
-       printk(KERN_INFO "pvrusb2: registered device %s%u [%s]\n",
-              get_v4l_name(dip->v4l_type), dip->devbase.num,
+       printk(KERN_INFO "pvrusb2: registered device %s [%s]\n",
+              video_device_node_name(&dip->devbase),
               pvr2_config_get_name(dip->config));
 
        pvr2_hdw_v4l_store_minor_number(vp->channel.mc_head->hdw,
index 89b620f6db7b41d8cc44ba901090b6cef666304a..819cf4e7c581da8684be7a0a1e0b83364d84dfba 100644 (file)
@@ -1807,7 +1807,7 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
                goto err_video_release;
        }
 
-       PWC_INFO("Registered as /dev/video%d.\n", pdev->vdev->num);
+       PWC_INFO("Registered as %s.\n", video_device_node_name(pdev->vdev));
 
        /* occupy slot */
        if (hint < MAX_DEV_HINTS)
index 0ba7f5af0fc33056a86d4e407cb10dd317b299d4..c07f072778105b1322ed0ddbbf22799beadb04ab 100644 (file)
@@ -1046,8 +1046,8 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
                       dev->name);
                goto fail4;
        }
-       printk(KERN_INFO "%s: registered device video%d [v4l2]\n",
-              dev->name, dev->video_dev->num);
+       printk(KERN_INFO "%s: registered device %s [v4l2]\n",
+              dev->name, video_device_node_name(dev->video_dev));
 
        dev->vbi_dev = vdev_init(dev, &saa7134_video_template, "vbi");
 
@@ -1055,8 +1055,8 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
                                    vbi_nr[dev->nr]);
        if (err < 0)
                goto fail4;
-       printk(KERN_INFO "%s: registered device vbi%d\n",
-              dev->name, dev->vbi_dev->num);
+       printk(KERN_INFO "%s: registered device %s\n",
+              dev->name, video_device_node_name(dev->vbi_dev));
 
        if (card_has_radio(dev)) {
                dev->radio_dev = vdev_init(dev,&saa7134_radio_template,"radio");
@@ -1064,8 +1064,8 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
                                            radio_nr[dev->nr]);
                if (err < 0)
                        goto fail4;
-               printk(KERN_INFO "%s: registered device radio%d\n",
-                      dev->name, dev->radio_dev->num);
+               printk(KERN_INFO "%s: registered device %s\n",
+                      dev->name, video_device_node_name(dev->radio_dev));
        }
 
        /* everything worked */
index 296788c3bf0ecc6ddc14301fb10bf198216e155a..abc1d0bf583793d1c4b8974d1fe9304687790ae3 100644 (file)
@@ -540,8 +540,8 @@ static int empress_init(struct saa7134_dev *dev)
                dev->empress_dev = NULL;
                return err;
        }
-       printk(KERN_INFO "%s: registered device video%d [mpeg]\n",
-              dev->name, dev->empress_dev->num);
+       printk(KERN_INFO "%s: registered device %s [mpeg]\n",
+              dev->name, video_device_node_name(dev->empress_dev));
 
        videobuf_queue_sg_init(&dev->empress_tsq, &saa7134_ts_qops,
                            &dev->pci->dev, &dev->slock,
index 85ffc2cba039b3e6114e5fc8d3bd4671bf9fea20..41d0166c0f95b5ff8156770155d3affe6ce874c5 100644 (file)
@@ -1428,8 +1428,8 @@ static int se401_probe(struct usb_interface *intf,
                err("video_register_device failed");
                return -EIO;
        }
-       dev_info(&intf->dev, "registered new video device: video%d\n",
-                se401->vdev.num);
+       dev_info(&intf->dev, "registered new video device: %s\n",
+                video_device_node_name(&se401->vdev));
 
        usb_set_intfdata(intf, se401);
        return 0;
index 4a7711c3e745f33f6e362ed246490a5e4d0971fe..4cf41a8d44ed6a4608ce91cf6cddf1466eec275c 100644 (file)
@@ -1007,8 +1007,8 @@ static int sn9c102_stream_interrupt(struct sn9c102_device* cam)
        else if (cam->stream != STREAM_OFF) {
                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->num);
+                      "To use it, close and open %s again.",
+                   video_device_node_name(cam->v4ldev));
                return -EIO;
        }
 
@@ -1734,7 +1734,8 @@ 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->num);
+       DBG(2, "V4L2 device %s deregistered",
+           video_device_node_name(cam->v4ldev));
        video_set_drvdata(cam->v4ldev, NULL);
        video_unregister_device(cam->v4ldev);
        usb_put_dev(cam->usbdev);
@@ -1791,8 +1792,8 @@ static int sn9c102_open(struct file *filp)
        }
 
        if (cam->users) {
-               DBG(2, "Device /dev/video%d is already in use",
-                      cam->v4ldev->num);
+               DBG(2, "Device %s is already in use",
+                   video_device_node_name(cam->v4ldev));
                DBG(3, "Simultaneous opens are not supported");
                /*
                   open() must follow the open flags and should block
@@ -1845,7 +1846,7 @@ static int sn9c102_open(struct file *filp)
        cam->frame_count = 0;
        sn9c102_empty_framequeues(cam);
 
-       DBG(3, "Video device /dev/video%d is open", cam->v4ldev->num);
+       DBG(3, "Video device %s is open", video_device_node_name(cam->v4ldev));
 
 out:
        mutex_unlock(&cam->open_mutex);
@@ -1870,7 +1871,7 @@ static int sn9c102_release(struct file *filp)
        cam->users--;
        wake_up_interruptible_nr(&cam->wait_open, 1);
 
-       DBG(3, "Video device /dev/video%d closed", cam->v4ldev->num);
+       DBG(3, "Video device %s closed", video_device_node_name(cam->v4ldev));
 
        kref_put(&cam->kref, sn9c102_release_resources);
 
@@ -2433,8 +2434,8 @@ sn9c102_vidioc_s_crop(struct sn9c102_device* cam, void __user * arg)
        if (err) { /* atomic, no rollback in ioctl() */
                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->num);
+                      "use the camera, close and open %s again.",
+                   video_device_node_name(cam->v4ldev));
                return -EIO;
        }
 
@@ -2446,8 +2447,8 @@ sn9c102_vidioc_s_crop(struct sn9c102_device* cam, void __user * arg)
            nbuffers != sn9c102_request_buffers(cam, nbuffers, cam->io)) {
                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->num);
+                      "use the camera, close and open %s again.",
+                   video_device_node_name(cam->v4ldev));
                return -ENOMEM;
        }
 
@@ -2690,8 +2691,8 @@ sn9c102_vidioc_try_s_fmt(struct sn9c102_device* cam, unsigned int cmd,
        if (err) { /* atomic, no rollback in ioctl() */
                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->num);
+                      "use the camera, close and open %s again.",
+                   video_device_node_name(cam->v4ldev));
                return -EIO;
        }
 
@@ -2702,8 +2703,8 @@ sn9c102_vidioc_try_s_fmt(struct sn9c102_device* cam, unsigned int cmd,
            nbuffers != sn9c102_request_buffers(cam, nbuffers, cam->io)) {
                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->num);
+                      "use the camera, close and open %s again.",
+                   video_device_node_name(cam->v4ldev));
                return -ENOMEM;
        }
 
@@ -2748,9 +2749,9 @@ sn9c102_vidioc_s_jpegcomp(struct sn9c102_device* cam, void __user * arg)
        err += sn9c102_set_compression(cam, &jc);
        if (err) { /* atomic, no rollback in ioctl() */
                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->num);
+               DBG(1, "VIDIOC_S_JPEGCOMP failed because of hardware problems. "
+                      "To use the camera, close and open %s again.",
+                   video_device_node_name(cam->v4ldev));
                return -EIO;
        }
 
@@ -3346,7 +3347,8 @@ 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->num);
+       DBG(2, "V4L2 device registered as %s",
+           video_device_node_name(cam->v4ldev));
 
        video_set_drvdata(cam->v4ldev, cam);
        cam->module_param.force_munmap = force_munmap[dev_nr];
@@ -3398,9 +3400,9 @@ static void sn9c102_usb_disconnect(struct usb_interface* intf)
        DBG(2, "Disconnecting %s...", cam->v4ldev->name);
 
        if (cam->users) {
-               DBG(2, "Device /dev/video%d is open! Deregistration and "
-                      "memory deallocation are deferred.",
-                   cam->v4ldev->num);
+               DBG(2, "Device %s is open! Deregistration and memory "
+                      "deallocation are deferred.",
+                   video_device_node_name(cam->v4ldev));
                cam->state |= DEV_MISCONFIGURED;
                sn9c102_stop_transfer(cam);
                cam->state |= DEV_DISCONNECTED;
index 6b41865f42bdaf93078be0229124e6af403e7fc4..6590b9299315519a0352bcffddcc788af1db4f0c 100644 (file)
@@ -1327,8 +1327,8 @@ static int stk_register_video_device(struct stk_camera *dev)
        if (err)
                STK_ERROR("v4l registration failed\n");
        else
-               STK_INFO("Syntek USB2.0 Camera is now controlling video device"
-                       " /dev/video%d\n", dev->vdev.num);
+               STK_INFO("Syntek USB2.0 Camera is now controlling device %s\n",
+                        video_device_node_name(&dev->vdev));
        return err;
 }
 
@@ -1418,8 +1418,8 @@ static void stk_camera_disconnect(struct usb_interface *interface)
        wake_up_interruptible(&dev->wait_frame);
        stk_remove_sysfs_files(&dev->vdev);
 
-       STK_INFO("Syntek USB2.0 Camera release resources "
-               "video device /dev/video%d\n", dev->vdev.num);
+       STK_INFO("Syntek USB2.0 Camera release resources device %s\n",
+                video_device_node_name(&dev->vdev));
 
        video_unregister_device(&dev->vdev);
 }
index 6a91714125d27dd2fc054a9f953656f24a9cc4ab..b54222232cd3d7d7412b2c3186b0f2183ecb5570 100644 (file)
@@ -1467,8 +1467,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->num);
+       PDEBUG(0, "STV(i): registered new video device: %s",
+               video_device_node_name(stv680->vdev));
 
        usb_set_intfdata (intf, stv680);
        retval = stv680_create_sysfs_files(stv680->vdev);
index dea8b321fb4a5b983f35da9f56fa6a83a22c1895..5ac37c6c43131503dc95cbf4e496bee1ee2d1460 100644 (file)
@@ -1053,9 +1053,9 @@ int usbvideo_RegisterVideoDevice(struct uvd *uvd)
                         "%s: video_register_device() successful\n", __func__);
        }
 
-       dev_info(&uvd->dev->dev, "%s on /dev/video%d: canvas=%s videosize=%s\n",
+       dev_info(&uvd->dev->dev, "%s on %s: canvas=%s videosize=%s\n",
                 (uvd->handle != NULL) ? uvd->handle->drvName : "???",
-                uvd->vdev.num, tmp2, tmp1);
+                video_device_node_name(&uvd->vdev), tmp2, tmp1);
 
        usb_get_dev(uvd->dev);
        return 0;
index 45fce39ec9ad56b77c5b7db00eca8dccf3d5a0f3..b75143ee5dd805bc903b0b5269635b592f7444d3 100644 (file)
@@ -873,8 +873,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.num);
+       printk(KERN_INFO "ViCam webcam driver now controlling device %s\n",
+               video_device_node_name(&cam->vdev));
 
        usb_set_intfdata (intf, cam);
 
index c07b0ac452abf8a986d134ab260e78ae5890f463..639c3396ae7713e7e7dfebf749f17b3ff30fba8e 100644 (file)
@@ -1416,8 +1416,8 @@ static void usbvision_unregister_video(struct usb_usbvision *usbvision)
 {
        // vbi Device:
        if (usbvision->vbi) {
-               PDEBUG(DBG_PROBE, "unregister /dev/vbi%d [v4l2]",
-                      usbvision->vbi->num);
+               PDEBUG(DBG_PROBE, "unregister %s [v4l2]",
+                      video_device_node_name(usbvision->vbi));
                if (usbvision->vbi->minor != -1) {
                        video_unregister_device(usbvision->vbi);
                } else {
@@ -1428,8 +1428,8 @@ static void usbvision_unregister_video(struct usb_usbvision *usbvision)
 
        // Radio Device:
        if (usbvision->rdev) {
-               PDEBUG(DBG_PROBE, "unregister /dev/radio%d [v4l2]",
-                      usbvision->rdev->num);
+               PDEBUG(DBG_PROBE, "unregister %s [v4l2]",
+                      video_device_node_name(usbvision->rdev));
                if (usbvision->rdev->minor != -1) {
                        video_unregister_device(usbvision->rdev);
                } else {
@@ -1440,8 +1440,8 @@ static void usbvision_unregister_video(struct usb_usbvision *usbvision)
 
        // Video Device:
        if (usbvision->vdev) {
-               PDEBUG(DBG_PROBE, "unregister /dev/video%d [v4l2]",
-                      usbvision->vdev->num);
+               PDEBUG(DBG_PROBE, "unregister %s [v4l2]",
+                      video_device_node_name(usbvision->vdev));
                if (usbvision->vdev->minor != -1) {
                        video_unregister_device(usbvision->vdev);
                } else {
@@ -1466,8 +1466,8 @@ static int __devinit usbvision_register_video(struct usb_usbvision *usbvision)
                                  video_nr)<0) {
                goto err_exit;
        }
-       printk(KERN_INFO "USBVision[%d]: registered USBVision Video device /dev/video%d [v4l2]\n",
-              usbvision->nr, usbvision->vdev->num);
+       printk(KERN_INFO "USBVision[%d]: registered USBVision Video device %s [v4l2]\n",
+              usbvision->nr, video_device_node_name(usbvision->vdev));
 
        // Radio Device:
        if (usbvision_device_data[usbvision->DevModel].Radio) {
@@ -1483,8 +1483,8 @@ static int __devinit usbvision_register_video(struct usb_usbvision *usbvision)
                                          radio_nr)<0) {
                        goto err_exit;
                }
-               printk(KERN_INFO "USBVision[%d]: registered USBVision Radio device /dev/radio%d [v4l2]\n",
-                      usbvision->nr, usbvision->rdev->num);
+               printk(KERN_INFO "USBVision[%d]: registered USBVision Radio device %s [v4l2]\n",
+                      usbvision->nr, video_device_node_name(usbvision->rdev));
        }
        // vbi Device:
        if (usbvision_device_data[usbvision->DevModel].vbi) {
@@ -1499,8 +1499,8 @@ static int __devinit usbvision_register_video(struct usb_usbvision *usbvision)
                                          vbi_nr)<0) {
                        goto err_exit;
                }
-               printk(KERN_INFO "USBVision[%d]: registered USBVision VBI device /dev/vbi%d [v4l2] (Not Working Yet!)\n",
-                      usbvision->nr, usbvision->vbi->num);
+               printk(KERN_INFO "USBVision[%d]: registered USBVision VBI device %s [v4l2] (Not Working Yet!)\n",
+                      usbvision->nr, video_device_node_name(usbvision->vbi));
        }
        // all done
        return 0;
index 7705fc6baf00d6eab93fbf43eb17bfb9febece0a..48f5a628c065ae9c5697a4ebdb261150dad608ad 100644 (file)
@@ -1148,7 +1148,8 @@ static int vivi_open(struct file *file)
                return -EBUSY;
        }
 
-       dprintk(dev, 1, "open /dev/video%d type=%s users=%d\n", dev->vfd->num,
+       dprintk(dev, 1, "open %s type=%s users=%d\n",
+               video_device_node_name(dev->vfd),
                v4l2_type_names[V4L2_BUF_TYPE_VIDEO_CAPTURE], dev->users);
 
        /* allocate + initialize per filehandle data */
@@ -1317,8 +1318,8 @@ static int vivi_release(void)
                list_del(list);
                dev = list_entry(list, struct vivi_dev, vivi_devlist);
 
-               v4l2_info(&dev->v4l2_dev, "unregistering /dev/video%d\n",
-                       dev->vfd->num);
+               v4l2_info(&dev->v4l2_dev, "unregistering %s\n",
+                       video_device_node_name(dev->vfd));
                video_unregister_device(dev->vfd);
                v4l2_device_unregister(&dev->v4l2_dev);
                kfree(dev);
@@ -1379,8 +1380,8 @@ static int __init vivi_create_instance(int inst)
                video_nr++;
 
        dev->vfd = vfd;
-       v4l2_info(&dev->v4l2_dev, "V4L2 device registered as /dev/video%d\n",
-                       vfd->num);
+       v4l2_info(&dev->v4l2_dev, "V4L2 device registered as %s\n",
+                 video_device_node_name(vfd));
        return 0;
 
 rel_vdev:
index 37fcdc447db589a37c00e6a95521500d5b047928..695ad2f46095e344832702256ef82fb468881f2f 100644 (file)
@@ -2323,9 +2323,9 @@ static int w9968cf_sensor_init(struct w9968cf_device* cam)
 error:
        cam->sensor_initialized = 0;
        cam->sensor = CC_UNKNOWN;
-       DBG(1, "Image sensor initialization failed for %s (/dev/video%d). "
+       DBG(1, "Image sensor initialization failed for %s (%s). "
               "Try to detach and attach this device again",
-           symbolic(camlist, cam->id), cam->v4ldev->num)
+           symbolic(camlist, cam->id), video_device_node_name(cam->v4ldev))
        return err;
 }
 
@@ -2571,7 +2571,8 @@ static void w9968cf_release_resources(struct w9968cf_device* cam)
 {
        mutex_lock(&w9968cf_devlist_mutex);
 
-       DBG(2, "V4L device deregistered: /dev/video%d", cam->v4ldev->num)
+       DBG(2, "V4L device deregistered: %s",
+           video_device_node_name(cam->v4ldev))
 
        video_unregister_device(cam->v4ldev);
        list_del(&cam->v4llist);
@@ -2605,17 +2606,19 @@ static int w9968cf_open(struct file *filp)
 
        if (cam->sensor == CC_UNKNOWN) {
                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->num)
+                      "'ovcamchip' module for the %s (%s). Make sure "
+                      "it is loaded *before* (re)connecting the camera.",
+                   symbolic(camlist, cam->id),
+                   video_device_node_name(cam->v4ldev))
                mutex_unlock(&cam->dev_mutex);
                up_read(&w9968cf_disconnect);
                return -ENODEV;
        }
 
        if (cam->users) {
-               DBG(2, "%s (/dev/video%d) has been already occupied by '%s'",
-                   symbolic(camlist, cam->id), cam->v4ldev->num, cam->command)
+               DBG(2, "%s (%s) has been already occupied by '%s'",
+                   symbolic(camlist, cam->id),
+                   video_device_node_name(cam->v4ldev), cam->command)
                if ((filp->f_flags & O_NONBLOCK)||(filp->f_flags & O_NDELAY)) {
                        mutex_unlock(&cam->dev_mutex);
                        up_read(&w9968cf_disconnect);
@@ -2636,8 +2639,8 @@ static int w9968cf_open(struct file *filp)
                mutex_lock(&cam->dev_mutex);
        }
 
-       DBG(5, "Opening '%s', /dev/video%d ...",
-           symbolic(camlist, cam->id), cam->v4ldev->num)
+       DBG(5, "Opening '%s', %s ...",
+           symbolic(camlist, cam->id), video_device_node_name(cam->v4ldev))
 
        cam->streaming = 0;
        cam->misconfigured = 0;
@@ -3501,7 +3504,8 @@ 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->num)
+       DBG(2, "V4L device registered as %s",
+           video_device_node_name(cam->v4ldev))
 
        /* Set some basic constants */
        w9968cf_configure_camera(cam, udev, mod_id, dev_nr);
@@ -3557,10 +3561,10 @@ static void w9968cf_usb_disconnect(struct usb_interface* intf)
                wake_up_interruptible_all(&cam->open);
 
                if (cam->users) {
-                       DBG(2, "The device is open (/dev/video%d)! "
+                       DBG(2, "The device is open (%s)! "
                               "Process name: %s. Deregistration and memory "
                               "deallocation are deferred on close.",
-                           cam->v4ldev->num, cam->command)
+                           video_device_node_name(cam->v4ldev), cam->command)
                        cam->misconfigured = 1;
                        w9968cf_stop_transfer(cam);
                        wake_up_interruptible(&cam->wait_queue);
index 312a71336fd040d3519a04b41901ce4bb70f6084..524eb754c97d27139be495ee6955ee474ea396ac 100644 (file)
@@ -538,8 +538,8 @@ static int zc0301_stream_interrupt(struct zc0301_device* cam)
        else if (cam->stream != STREAM_OFF) {
                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->num);
+                      "use it, close and open %s again.",
+                   video_device_node_name(cam->v4ldev));
                return -EIO;
        }
 
@@ -640,7 +640,8 @@ 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->num);
+       DBG(2, "V4L2 device %s deregistered",
+           video_device_node_name(cam->v4ldev));
        video_set_drvdata(cam->v4ldev, NULL);
        video_unregister_device(cam->v4ldev);
        usb_put_dev(cam->usbdev);
@@ -679,7 +680,8 @@ static int zc0301_open(struct file *filp)
        }
 
        if (cam->users) {
-               DBG(2, "Device /dev/video%d is busy...", cam->v4ldev->num);
+               DBG(2, "Device %s is busy...",
+                   video_device_node_name(cam->v4ldev));
                DBG(3, "Simultaneous opens are not supported");
                if ((filp->f_flags & O_NONBLOCK) ||
                    (filp->f_flags & O_NDELAY)) {
@@ -722,7 +724,8 @@ static int zc0301_open(struct file *filp)
        cam->frame_count = 0;
        zc0301_empty_framequeues(cam);
 
-       DBG(3, "Video device /dev/video%d is open", cam->v4ldev->num);
+       DBG(3, "Video device %s is open",
+           video_device_node_name(cam->v4ldev));
 
 out:
        mutex_unlock(&cam->open_mutex);
@@ -746,7 +749,8 @@ static int zc0301_release(struct file *filp)
        cam->users--;
        wake_up_interruptible_nr(&cam->wait_open, 1);
 
-       DBG(3, "Video device /dev/video%d closed", cam->v4ldev->num);
+       DBG(3, "Video device %s closed",
+           video_device_node_name(cam->v4ldev));
 
        kref_put(&cam->kref, zc0301_release_resources);
 
@@ -1276,8 +1280,8 @@ zc0301_vidioc_s_crop(struct zc0301_device* cam, void __user * arg)
        if (err) { /* atomic, no rollback in ioctl() */
                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->num);
+                      "use the camera, close and open %s again.",
+                   video_device_node_name(cam->v4ldev));
                return -EIO;
        }
 
@@ -1289,8 +1293,8 @@ zc0301_vidioc_s_crop(struct zc0301_device* cam, void __user * arg)
            nbuffers != zc0301_request_buffers(cam, nbuffers, cam->io)) {
                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->num);
+                      "use the camera, close and open %s again.",
+                   video_device_node_name(cam->v4ldev));
                return -ENOMEM;
        }
 
@@ -1471,8 +1475,8 @@ zc0301_vidioc_try_s_fmt(struct zc0301_device* cam, unsigned int cmd,
        if (err) { /* atomic, no rollback in ioctl() */
                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->num);
+                      "use the camera, close and open %s again.",
+                   video_device_node_name(cam->v4ldev));
                return -EIO;
        }
 
@@ -1483,8 +1487,8 @@ zc0301_vidioc_try_s_fmt(struct zc0301_device* cam, unsigned int cmd,
            nbuffers != zc0301_request_buffers(cam, nbuffers, cam->io)) {
                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->num);
+                      "use the camera, close and open %s again.",
+                   video_device_node_name(cam->v4ldev));
                return -ENOMEM;
        }
 
@@ -1530,8 +1534,8 @@ zc0301_vidioc_s_jpegcomp(struct zc0301_device* cam, void __user * arg)
        if (err) { /* atomic, no rollback in ioctl() */
                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->num);
+                      "problems. To use the camera, close and open %s again.",
+                      video_device_node_name(cam->v4ldev));
                return -EIO;
        }
 
@@ -2003,7 +2007,8 @@ 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->num);
+       DBG(2, "V4L2 device registered as %s",
+           video_device_node_name(cam->v4ldev));
 
        cam->module_param.force_munmap = force_munmap[dev_nr];
        cam->module_param.frame_timeout = frame_timeout[dev_nr];
@@ -2040,9 +2045,9 @@ static void zc0301_usb_disconnect(struct usb_interface* intf)
        DBG(2, "Disconnecting %s...", cam->v4ldev->name);
 
        if (cam->users) {
-               DBG(2, "Device /dev/video%d is open! Deregistration and "
+               DBG(2, "Device %s is open! Deregistration and "
                       "memory deallocation are deferred.",
-                   cam->v4ldev->num);
+                   video_device_node_name(cam->v4ldev));
                cam->state |= DEV_MISCONFIGURED;
                zc0301_stop_transfer(cam);
                cam->state |= DEV_DISCONNECTED;
index 2ef110b5221bd961d2d66fe995969cc133f870bb..69ea6df62ab277113b8d27a08cbcb17b096c42f2 100644 (file)
@@ -1635,8 +1635,8 @@ static int zr364xx_probe(struct usb_interface *intf,
 
        spin_lock_init(&cam->slock);
 
-       dev_info(&udev->dev, DRIVER_DESC " controlling video device %d\n",
-                cam->vdev->num);
+       dev_info(&udev->dev, DRIVER_DESC " controlling device %s\n",
+                video_device_node_name(cam->vdev));
        return 0;
 }
 
index b18d8e2d4c5e78cc9b20799257e92716f091d704..fe739752c92dbb8569de3247138b1f288f713a16 100644 (file)
@@ -1817,8 +1817,8 @@ int go7007_v4l2_init(struct go7007 *go)
        }
        video_set_drvdata(go->video_dev, go);
        ++go->ref_count;
-       printk(KERN_INFO "%s: registered device video%d [v4l2]\n",
-              go->video_dev->name, go->video_dev->num);
+       printk(KERN_INFO "%s: registered device %s [v4l2]\n",
+              go->video_dev->name, video_device_node_name(go->video_dev));
 
        return 0;
 }