===================================================================
@@ -619,8 +619,8 @@ static int __video_register_device(struc
vdev->dev.release = v4l2_device_release;
if (nr != -1 && nr != vdev->num && warn_if_nr_in_use)
- printk(KERN_WARNING "%s: requested %s%d, got %s%d\n",
- __func__, name_base, nr, name_base, vdev->num);
+ printk(KERN_WARNING "%s: requested %s%d, got %s\n", __func__,
+ name_base, nr, video_device_node_name(vdev));
/* Part 5: Activate this minor. The char device can now be used. */
mutex_lock(&videodev_lock);
===================================================================
@@ -153,6 +153,15 @@ static inline void *video_drvdata(struct
return video_get_drvdata(video_devdata(file));
}
+static inline const char *video_device_node_name(struct video_device *vdev)
+{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19)
+ return vdev->dev.class_id;
+#else
+ return dev_name(&vdev->dev);
+#endif
+}
+
static inline int video_is_unregistered(struct video_device *vdev)
{
return test_bit(V4L2_FL_UNREGISTERED, &vdev->flags);