include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit...
[safe/jmp/linux-2.6] / drivers / media / video / cx231xx / cx231xx-video.c
index 606f801..16a73ea 100644 (file)
@@ -32,6 +32,7 @@
 #include <linux/version.h>
 #include <linux/mm.h>
 #include <linux/mutex.h>
+#include <linux/slab.h>
 
 #include <media/v4l2-common.h>
 #include <media/v4l2-ioctl.h>
@@ -704,7 +705,7 @@ buffer_setup(struct videobuf_queue *vq, unsigned int *count, unsigned int *size)
        f.frequency = dev->ctl_freq;
        f.type = fh->radio ? V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV;
 
-       cx231xx_i2c_call_clients(&dev->i2c_bus[1], VIDIOC_S_FREQUENCY, &f);
+       call_all(dev, tuner, s_frequency, &f);
 
        return 0;
 }
@@ -820,18 +821,12 @@ static struct videobuf_queue_ops cx231xx_video_qops = {
 
 void video_mux(struct cx231xx *dev, int index)
 {
-
-       struct v4l2_routing route;
-
-       route.input = INPUT(index)->vmux;
-       route.output = 0;
        dev->video_input = index;
        dev->ctl_ainput = INPUT(index)->amux;
 
        cx231xx_set_video_input_mux(dev, index);
 
-       cx231xx_i2c_call_clients(&dev->i2c_bus[0], VIDIOC_INT_S_VIDEO_ROUTING,
-                                &route);
+       cx25840_call(dev, video, s_routing, INPUT(index)->vmux, 0, 0);
 
        cx231xx_set_audio_input(dev, dev->ctl_ainput);
 
@@ -899,9 +894,9 @@ static int check_dev(struct cx231xx *dev)
        return 0;
 }
 
-void get_scale(struct cx231xx *dev,
-              unsigned int width, unsigned int height,
-              unsigned int *hscale, unsigned int *vscale)
+static void get_scale(struct cx231xx *dev,
+                     unsigned int width, unsigned int height,
+                     unsigned int *hscale, unsigned int *vscale)
 {
        unsigned int maxw = norm_maxw(dev);
        unsigned int maxh = norm_maxh(dev);
@@ -913,10 +908,6 @@ void get_scale(struct cx231xx *dev,
        *vscale = (((unsigned long)maxh) << 12) / height - 4096L;
        if (*vscale >= 0x4000)
                *vscale = 0x3fff;
-
-       dev->hscale = *hscale;
-       dev->vscale = *vscale;
-
 }
 
 /* ------------------------------------------------------------------
@@ -933,8 +924,8 @@ static int vidioc_g_fmt_vid_cap(struct file *file, void *priv,
 
        f->fmt.pix.width = dev->width;
        f->fmt.pix.height = dev->height;
-       f->fmt.pix.pixelformat = dev->format->fourcc;;
-       f->fmt.pix.bytesperline = (dev->width * dev->format->depth + 7) >> 3;;
+       f->fmt.pix.pixelformat = dev->format->fourcc;
+       f->fmt.pix.bytesperline = (dev->width * dev->format->depth + 7) >> 3;
        f->fmt.pix.sizeimage = f->fmt.pix.bytesperline * dev->height;
        f->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M;
 
@@ -961,8 +952,8 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
 {
        struct cx231xx_fh *fh = priv;
        struct cx231xx *dev = fh->dev;
-       int width = f->fmt.pix.width;
-       int height = f->fmt.pix.height;
+       unsigned int width = f->fmt.pix.width;
+       unsigned int height = f->fmt.pix.height;
        unsigned int maxw = norm_maxw(dev);
        unsigned int maxh = norm_maxh(dev);
        unsigned int hscale, vscale;
@@ -977,17 +968,7 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
 
        /* width must even because of the YUYV format
           height must be even because of interlacing */
-       height &= 0xfffe;
-       width &= 0xfffe;
-
-       if (unlikely(height < 32))
-               height = 32;
-       if (unlikely(height > maxh))
-               height = maxh;
-       if (unlikely(width < 48))
-               width = 48;
-       if (unlikely(width > maxw))
-               width = maxw;
+       v4l_bound_align_image(&width, 48, maxw, 1, &height, 32, maxh, 1, 0);
 
        get_scale(dev, width, height, &hscale, &vscale);
 
@@ -1045,7 +1026,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
        dev->format = fmt;
        get_scale(dev, dev->width, dev->height, &dev->hscale, &dev->vscale);
 
-       cx231xx_i2c_call_clients(&dev->i2c_bus[0], VIDIOC_S_FMT, f);
+       call_all(dev, video, s_fmt, f);
 
        /* Set the correct alternate setting for this resolution */
        cx231xx_resolution_set(dev);
@@ -1064,7 +1045,7 @@ static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id * id)
        return 0;
 }
 
-static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id * norm)
+static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *norm)
 {
        struct cx231xx_fh *fh = priv;
        struct cx231xx *dev = fh->dev;
@@ -1090,7 +1071,7 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id * norm)
        dev->height = f.fmt.pix.height;
        get_scale(dev, dev->width, dev->height, &dev->hscale, &dev->vscale);
 
-       cx231xx_i2c_call_clients(&dev->i2c_bus[0], VIDIOC_S_STD, &dev->norm);
+       call_all(dev, core, s_std, dev->norm);
 
        mutex_unlock(&dev->lock);
 
@@ -1244,7 +1225,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
        *qc = cx231xx_ctls[i].v;
 
        mutex_lock(&dev->lock);
-       cx231xx_i2c_call_clients(&dev->i2c_bus[0], VIDIOC_QUERYCTRL, qc);
+       call_all(dev, core, queryctrl, qc);
        mutex_unlock(&dev->lock);
 
        if (qc->type)
@@ -1265,9 +1246,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
                return rc;
 
        mutex_lock(&dev->lock);
-
-       cx231xx_i2c_call_clients(&dev->i2c_bus[0], VIDIOC_G_CTRL, ctrl);
-
+       call_all(dev, core, g_ctrl, ctrl);
        mutex_unlock(&dev->lock);
        return rc;
 }
@@ -1284,9 +1263,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
                return rc;
 
        mutex_lock(&dev->lock);
-
-       cx231xx_i2c_call_clients(&dev->i2c_bus[0], VIDIOC_S_CTRL, ctrl);
-
+       call_all(dev, core, s_ctrl, ctrl);
        mutex_unlock(&dev->lock);
        return rc;
 }
@@ -1328,9 +1305,7 @@ static int vidioc_s_tuner(struct file *file, void *priv, struct v4l2_tuner *t)
                return -EINVAL;
 #if 0
        mutex_lock(&dev->lock);
-
-       cx231xx_i2c_call_clients(&dev->i2c_bus[1], VIDIOC_S_TUNER, t);
-
+       call_all(dev, tuner, s_tuner, t);
        mutex_unlock(&dev->lock);
 #endif
        return 0;
@@ -1346,7 +1321,7 @@ static int vidioc_g_frequency(struct file *file, void *priv,
        f->type = fh->radio ? V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV;
        f->frequency = dev->ctl_freq;
 
-       cx231xx_i2c_call_clients(&dev->i2c_bus[1], VIDIOC_G_FREQUENCY, f);
+       call_all(dev, tuner, g_frequency, f);
 
        mutex_unlock(&dev->lock);
 
@@ -1382,10 +1357,8 @@ static int vidioc_s_frequency(struct file *file, void *priv,
        if (dev->tuner_type == TUNER_XC5000) {
                if (dev->cx231xx_set_analog_freq != NULL)
                        dev->cx231xx_set_analog_freq(dev, f->frequency);
-       } else {
-               cx231xx_i2c_call_clients(&dev->i2c_bus[1],
-                                        VIDIOC_S_FREQUENCY, f);
-       }
+       } else
+               call_all(dev, tuner, s_frequency, f);
 
        mutex_unlock(&dev->lock);
 
@@ -1430,36 +1403,36 @@ static int vidioc_g_register(struct file *file, void *priv,
                        reg->val = value[0] | value[1] << 8 |
                                   value[2] << 16 | value[3] << 24;
                        break;
-               case 1: /* Colibri - read byte */
-                       ret = cx231xx_read_i2c_data(dev, Colibri_DEVICE_ADDRESS,
+               case 1: /* AFE - read byte */
+                       ret = cx231xx_read_i2c_data(dev, AFE_DEVICE_ADDRESS,
                                                  (u16)reg->reg, 2, &data, 1);
                        reg->val = le32_to_cpu(data & 0xff);
                        break;
-               case 14:        /* Colibri - read dword */
-                       ret = cx231xx_read_i2c_data(dev, Colibri_DEVICE_ADDRESS,
+               case 14: /* AFE - read dword */
+                       ret = cx231xx_read_i2c_data(dev, AFE_DEVICE_ADDRESS,
                                                  (u16)reg->reg, 2, &data, 4);
                        reg->val = le32_to_cpu(data);
                        break;
-               case 2: /* Hammerhead - read byte */
-                       ret = cx231xx_read_i2c_data(dev, HAMMERHEAD_I2C_ADDRESS,
+               case 2: /* Video Block - read byte */
+                       ret = cx231xx_read_i2c_data(dev, VID_BLK_I2C_ADDRESS,
                                                  (u16)reg->reg, 2, &data, 1);
                        reg->val = le32_to_cpu(data & 0xff);
                        break;
-               case 24:        /* Hammerhead - read dword */
-                       ret = cx231xx_read_i2c_data(dev, HAMMERHEAD_I2C_ADDRESS,
+               case 24: /* Video Block - read dword */
+                       ret = cx231xx_read_i2c_data(dev, VID_BLK_I2C_ADDRESS,
                                                  (u16)reg->reg, 2, &data, 4);
                        reg->val = le32_to_cpu(data);
                        break;
-               case 3: /* flatiron - read byte */
+               case 3: /* I2S block - read byte */
                        ret = cx231xx_read_i2c_data(dev,
-                                                   Flatrion_DEVICE_ADDRESS,
+                                                   I2S_BLK_DEVICE_ADDRESS,
                                                    (u16)reg->reg, 1,
                                                    &data, 1);
                        reg->val = le32_to_cpu(data & 0xff);
                        break;
-               case 34:        /* flatiron - read dword */
+               case 34: /* I2S Block - read dword */
                        ret =
-                           cx231xx_read_i2c_data(dev, Flatrion_DEVICE_ADDRESS,
+                           cx231xx_read_i2c_data(dev, I2S_BLK_DEVICE_ADDRESS,
                                                  (u16)reg->reg, 1, &data, 4);
                        reg->val = le32_to_cpu(data);
                        break;
@@ -1467,8 +1440,7 @@ static int vidioc_g_register(struct file *file, void *priv,
                return ret < 0 ? ret : 0;
 
        case V4L2_CHIP_MATCH_I2C_DRIVER:
-               cx231xx_i2c_call_clients(&dev->i2c_bus[0],
-                                        VIDIOC_DBG_G_REGISTER, reg);
+               call_all(dev, core, g_register, reg);
                return 0;
        case V4L2_CHIP_MATCH_I2C_ADDR:
                /* Not supported yet */
@@ -1479,7 +1451,7 @@ static int vidioc_g_register(struct file *file, void *priv,
        }
 
        mutex_lock(&dev->lock);
-       cx231xx_i2c_call_clients(&dev->i2c_bus[0], VIDIOC_DBG_G_REGISTER, reg);
+       call_all(dev, core, g_register, reg);
        mutex_unlock(&dev->lock);
 
        return ret;
@@ -1513,43 +1485,43 @@ static int vidioc_s_register(struct file *file, void *priv,
                                                           (u16)reg->reg, data,
                                                           4);
                                break;
-                       case 1: /* Colibri - read byte */
+                       case 1: /* AFE - read byte */
                                ret = cx231xx_write_i2c_data(dev,
-                                                       Colibri_DEVICE_ADDRESS,
+                                                       AFE_DEVICE_ADDRESS,
                                                        (u16)reg->reg, 2,
                                                        value, 1);
                                break;
-                       case 14:        /* Colibri - read dword */
+                       case 14: /* AFE - read dword */
                                ret = cx231xx_write_i2c_data(dev,
-                                                       Colibri_DEVICE_ADDRESS,
+                                                       AFE_DEVICE_ADDRESS,
                                                        (u16)reg->reg, 2,
                                                        value, 4);
                                break;
-                       case 2: /* Hammerhead - read byte */
+                       case 2: /* Video Block - read byte */
                                ret =
                                    cx231xx_write_i2c_data(dev,
-                                                       HAMMERHEAD_I2C_ADDRESS,
+                                                       VID_BLK_I2C_ADDRESS,
                                                        (u16)reg->reg, 2,
                                                        value, 1);
                                break;
-                       case 24:        /* Hammerhead - read dword */
+                       case 24: /* Video Block - read dword */
                                ret =
                                    cx231xx_write_i2c_data(dev,
-                                                       HAMMERHEAD_I2C_ADDRESS,
+                                                       VID_BLK_I2C_ADDRESS,
                                                        (u16)reg->reg, 2,
                                                        value, 4);
                                break;
-                       case 3: /* flatiron - read byte */
+                       case 3: /* I2S block - read byte */
                                ret =
                                    cx231xx_write_i2c_data(dev,
-                                                       Flatrion_DEVICE_ADDRESS,
+                                                       I2S_BLK_DEVICE_ADDRESS,
                                                        (u16)reg->reg, 1,
                                                        value, 1);
                                break;
-                       case 34:        /* flatiron - read dword */
+                       case 34: /* I2S block - read dword */
                                ret =
                                    cx231xx_write_i2c_data(dev,
-                                                       Flatrion_DEVICE_ADDRESS,
+                                                       I2S_BLK_DEVICE_ADDRESS,
                                                        (u16)reg->reg, 1,
                                                        value, 4);
                                break;
@@ -1562,9 +1534,7 @@ static int vidioc_s_register(struct file *file, void *priv,
        }
 
        mutex_lock(&dev->lock);
-
-       cx231xx_i2c_call_clients(&dev->i2c_bus[0], VIDIOC_DBG_S_REGISTER, reg);
-
+       call_all(dev, core, s_register, reg);
        mutex_unlock(&dev->lock);
 
        return ret;
@@ -1608,6 +1578,8 @@ static int vidioc_streamon(struct file *file, void *priv,
        if (likely(rc >= 0))
                rc = videobuf_streamon(&fh->vb_vidq);
 
+       call_all(dev, video, s_stream, 1);
+
        mutex_unlock(&dev->lock);
 
        return rc;
@@ -1624,7 +1596,7 @@ static int vidioc_streamoff(struct file *file, void *priv,
        if (rc < 0)
                return rc;
 
-       if ((fh->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) ||
+       if ((fh->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) &&
            (fh->type != V4L2_BUF_TYPE_VBI_CAPTURE))
                return -EINVAL;
        if (type != fh->type)
@@ -1632,6 +1604,8 @@ static int vidioc_streamoff(struct file *file, void *priv,
 
        mutex_lock(&dev->lock);
 
+       cx25840_call(dev, video, s_stream, 0);
+
        videobuf_streamoff(&fh->vb_vidq);
        res_free(fh);
 
@@ -1648,8 +1622,7 @@ static int vidioc_querycap(struct file *file, void *priv,
 
        strlcpy(cap->driver, "cx231xx", sizeof(cap->driver));
        strlcpy(cap->card, cx231xx_boards[dev->model].name, sizeof(cap->card));
-       strlcpy(cap->bus_info, dev_name(&dev->udev->dev),
-               sizeof(cap->bus_info));
+       usb_make_path(dev->udev, cap->bus_info, sizeof(cap->bus_info));
 
        cap->version = CX231XX_VERSION_CODE;
 
@@ -1696,7 +1669,7 @@ static int vidioc_g_fmt_sliced_vbi_cap(struct file *file, void *priv,
 
        f->fmt.sliced.service_set = 0;
 
-       cx231xx_i2c_call_clients(&dev->i2c_bus[0], VIDIOC_G_FMT, f);
+       call_all(dev, video, g_fmt, f);
 
        if (f->fmt.sliced.service_set == 0)
                rc = -EINVAL;
@@ -1717,7 +1690,7 @@ static int vidioc_try_set_sliced_vbi_cap(struct file *file, void *priv,
                return rc;
 
        mutex_lock(&dev->lock);
-       cx231xx_i2c_call_clients(&dev->i2c_bus[0], VIDIOC_G_FMT, f);
+       call_all(dev, video, g_fmt, f);
        mutex_unlock(&dev->lock);
 
        if (f->fmt.sliced.service_set == 0)
@@ -1872,7 +1845,7 @@ static int radio_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t)
        t->type = V4L2_TUNER_RADIO;
 
        mutex_lock(&dev->lock);
-       cx231xx_i2c_call_clients(&dev->i2c_bus[1], VIDIOC_G_TUNER, t);
+       call_all(dev, tuner, s_tuner, t);
        mutex_unlock(&dev->lock);
 
        return 0;
@@ -1905,7 +1878,7 @@ static int radio_s_tuner(struct file *file, void *priv, struct v4l2_tuner *t)
                return -EINVAL;
 
        mutex_lock(&dev->lock);
-       cx231xx_i2c_call_clients(&dev->i2c_bus[1], VIDIOC_S_TUNER, t);
+       call_all(dev, tuner, s_tuner, t);
        mutex_unlock(&dev->lock);
 
        return 0;
@@ -1944,20 +1917,29 @@ static int radio_queryctrl(struct file *file, void *priv,
  */
 static int cx231xx_v4l2_open(struct file *filp)
 {
-       int minor = video_devdata(filp)->minor;
        int errCode = 0, radio = 0;
-       struct cx231xx *dev = NULL;
+       struct video_device *vdev = video_devdata(filp);
+       struct cx231xx *dev = video_drvdata(filp);
        struct cx231xx_fh *fh;
        enum v4l2_buf_type fh_type = 0;
 
-       dev = cx231xx_get_device(minor, &fh_type, &radio);
-       if (NULL == dev)
-               return -ENODEV;
+       switch (vdev->vfl_type) {
+       case VFL_TYPE_GRABBER:
+               fh_type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+               break;
+       case VFL_TYPE_VBI:
+               fh_type = V4L2_BUF_TYPE_VBI_CAPTURE;
+               break;
+       case VFL_TYPE_RADIO:
+               radio = 1;
+               break;
+       }
 
        mutex_lock(&dev->lock);
 
-       cx231xx_videodbg("open minor=%d type=%s users=%d\n",
-                        minor, v4l2_type_names[fh_type], dev->users);
+       cx231xx_videodbg("open dev=%s type=%s users=%d\n",
+                        video_device_node_name(vdev), v4l2_type_names[fh_type],
+                        dev->users);
 
 #if 0
        errCode = cx231xx_set_mode(dev, CX231XX_ANALOG_MODE);
@@ -2011,8 +1993,7 @@ static int cx231xx_v4l2_open(struct file *filp)
 
                /* cx231xx_start_radio(dev); */
 
-               cx231xx_i2c_call_clients(&dev->i2c_bus[1], AUDC_SET_RADIO,
-                                        NULL);
+               call_all(dev, tuner, s_radio);
        }
 
        dev->users++;
@@ -2049,25 +2030,25 @@ void cx231xx_release_analog_resources(struct cx231xx *dev)
        /*FIXME: I2C IR should be disconnected */
 
        if (dev->radio_dev) {
-               if (-1 != dev->radio_dev->minor)
+               if (video_is_registered(dev->radio_dev))
                        video_unregister_device(dev->radio_dev);
                else
                        video_device_release(dev->radio_dev);
                dev->radio_dev = NULL;
        }
        if (dev->vbi_dev) {
-               cx231xx_info("V4L2 device /dev/vbi%d deregistered\n",
-                            dev->vbi_dev->num);
-               if (-1 != dev->vbi_dev->minor)
+               cx231xx_info("V4L2 device %s deregistered\n",
+                            video_device_node_name(dev->vbi_dev));
+               if (video_is_registered(dev->vbi_dev))
                        video_unregister_device(dev->vbi_dev);
                else
                        video_device_release(dev->vbi_dev);
                dev->vbi_dev = NULL;
        }
        if (dev->vdev) {
-               cx231xx_info("V4L2 device /dev/video%d deregistered\n",
-                            dev->vdev->num);
-               if (-1 != dev->vdev->minor)
+               cx231xx_info("V4L2 device %s deregistered\n",
+                            video_device_node_name(dev->vdev));
+               if (video_is_registered(dev->vdev))
                        video_unregister_device(dev->vdev);
                else
                        video_device_release(dev->vdev);
@@ -2135,8 +2116,7 @@ static int cx231xx_v4l2_close(struct file *filp)
                }
 
                /* Save some power by putting tuner to sleep */
-               cx231xx_i2c_call_clients(&dev->i2c_bus[1], TUNER_SET_STANDBY,
-                                        NULL);
+               call_all(dev, core, s_power, 0);
 
                /* do this before setting alternate! */
                cx231xx_uninit_isoc(dev);
@@ -2298,7 +2278,6 @@ static const struct video_device cx231xx_video_template = {
        .fops         = &cx231xx_v4l_fops,
        .release      = video_device_release,
        .ioctl_ops    = &video_ioctl_ops,
-       .minor        = -1,
        .tvnorms      = V4L2_STD_ALL,
        .current_norm = V4L2_STD_PAL,
 };
@@ -2333,7 +2312,6 @@ static struct video_device cx231xx_radio_template = {
        .name      = "cx231xx-radio",
        .fops      = &radio_fops,
        .ioctl_ops = &radio_ioctl_ops,
-       .minor     = -1,
 };
 
 /******************************** usb interface ******************************/
@@ -2349,13 +2327,13 @@ static struct video_device *cx231xx_vdev_init(struct cx231xx *dev,
                return NULL;
 
        *vfd = *template;
-       vfd->minor = -1;
-       vfd->parent = &dev->udev->dev;
+       vfd->v4l2_dev = &dev->v4l2_dev;
        vfd->release = video_device_release;
        vfd->debug = video_debug;
 
        snprintf(vfd->name, sizeof(vfd->name), "%s %s", dev->name, type_name);
 
+       video_set_drvdata(vfd, dev);
        return vfd;
 }
 
@@ -2363,8 +2341,6 @@ int cx231xx_register_analog_devices(struct cx231xx *dev)
 {
        int ret;
 
-       cx231xx_info("%s()\n", __func__);
-
        cx231xx_info("%s: v4l2 driver version %d.%d.%d\n",
                     dev->name,
                     (CX231XX_VERSION_CODE >> 16) & 0xff,
@@ -2406,8 +2382,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,
@@ -2425,8 +2401,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,
@@ -2441,12 +2417,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;
 }