diff options
-rw-r--r-- | linux/drivers/media/video/videodev.c | 22 | ||||
-rw-r--r-- | v4l/ChangeLog | 9 |
2 files changed, 28 insertions, 3 deletions
diff --git a/linux/drivers/media/video/videodev.c b/linux/drivers/media/video/videodev.c index e4cef6d4a..cc180733e 100644 --- a/linux/drivers/media/video/videodev.c +++ b/linux/drivers/media/video/videodev.c @@ -48,6 +48,16 @@ static ssize_t show_name(struct class_device *cd, char *buf) } static CLASS_DEVICE_ATTR(name, S_IRUGO, show_name, NULL); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12) +static ssize_t show_dev(struct class_device *cd, char *buf) +{ + struct video_device *vfd = container_of(cd, struct video_device, class_dev); + dev_t dev = MKDEV(VIDEO_MAJOR, vfd->minor); + return print_dev_t(buf,dev); +} + +static CLASS_DEVICE_ATTR(dev, S_IRUGO, show_dev, NULL); +#endif struct video_device *video_device_alloc(void) { @@ -70,7 +80,7 @@ static void video_release(struct class_device *cd) struct video_device *vfd = container_of(cd, struct video_device, class_dev); #if 1 /* keep */ - /* needed until all drivers are fixed */ + /* needed until all drivers are fixed */ if (!vfd->release) return; #endif @@ -340,11 +350,17 @@ int video_register_device(struct video_device *vfd, int type, int nr) if (vfd->dev) vfd->class_dev.dev = vfd->dev; vfd->class_dev.class = &video_class; - vfd->class_dev.devt = MKDEV(VIDEO_MAJOR, vfd->minor); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12) + vfd->class_dev.devt = MKDEV(VIDEO_MAJOR, vfd->minor); +#endif strlcpy(vfd->class_dev.class_id, vfd->devfs_name + 4, BUS_ID_SIZE); class_device_register(&vfd->class_dev); class_device_create_file(&vfd->class_dev, - &class_device_attr_name); + &class_device_attr_name); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12) + class_device_create_file(&vfd->class_dev, + &class_device_attr_dev); +#endif #if 1 /* keep */ /* needed until all drivers are fixed */ diff --git a/v4l/ChangeLog b/v4l/ChangeLog index ddf736a67..0a03a991a 100644 --- a/v4l/ChangeLog +++ b/v4l/ChangeLog @@ -1,3 +1,12 @@ +2005-12-22 19:03 mkrufky + + * linux/drivers/media/video/videodev.c: (show_dev), + (video_release), (video_register_device): + - fixed videodev.c broken backwards compat for kernels < 2.6.12 + - minor whitespace cleanups + + Signed-off-by: Michael Krufky <mkrufky@m1k.net> + 2005-12-22 16:14 mkrufky * v4l/Makefile: |