diff options
author | Michael Krufky <devnull@localhost> | 2005-12-22 19:06:33 +0000 |
---|---|---|
committer | Michael Krufky <devnull@localhost> | 2005-12-22 19:06:33 +0000 |
commit | cc0299a9a4a83c00879b53d0d9171d183192d23c (patch) | |
tree | 7a434ee984d7f19cc0f2969926971559a3f365a9 /linux/drivers/media/video/videodev.c | |
parent | 78750e9968b14d3ae0eb72489c6e857d950ae3c6 (diff) | |
download | mediapointer-dvb-s2-cc0299a9a4a83c00879b53d0d9171d183192d23c.tar.gz mediapointer-dvb-s2-cc0299a9a4a83c00879b53d0d9171d183192d23c.tar.bz2 |
minor whitespace cleanups; fixed videodev.c broken backwards compat for kernels < 2.6.12
- fixed videodev.c broken backwards compat for kernels < 2.6.12
- minor whitespace cleanups
Signed-off-by: Michael Krufky <mkrufky@m1k.net>
Diffstat (limited to 'linux/drivers/media/video/videodev.c')
-rw-r--r-- | linux/drivers/media/video/videodev.c | 22 |
1 files changed, 19 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 */ |