From 68a97b349e64755edc45ac762b1b4ca3eb0fbcf9 Mon Sep 17 00:00:00 2001 From: Trent Piepho Date: Tue, 25 Jul 2006 09:32:49 -0300 Subject: bttv: clean up some pre-2.6.0 class device compat stuff From: Trent Piepho Add bit of compat code for class_device_create_file() to compat.h for pre-2.6.0 kernels. This allows an #ifdef to be removed from bttv-driver.c, and helps other code which never had one. Changed the code to turn on for pre-2.6.0, rather than pre-2.5.0, as the class device stuff was added in 2.5.69. Signed-off-by: Trent Piepho --- linux/drivers/media/video/bt8xx/bttv-driver.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'linux/drivers/media') diff --git a/linux/drivers/media/video/bt8xx/bttv-driver.c b/linux/drivers/media/video/bt8xx/bttv-driver.c index b0342f583..7f75861b0 100644 --- a/linux/drivers/media/video/bt8xx/bttv-driver.c +++ b/linux/drivers/media/video/bt8xx/bttv-driver.c @@ -158,7 +158,7 @@ MODULE_LICENSE("GPL"); /* ----------------------------------------------------------------------- */ /* sysfs */ -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) static ssize_t show_card(struct class_device *cd, char *buf) { struct video_device *vfd = to_video_device(cd); @@ -3956,14 +3956,12 @@ static int __devinit bttv_register_video(struct bttv *btv) goto err; printk(KERN_INFO "bttv%d: registered device video%d\n", btv->c.nr,btv->video_dev->minor & 0x1f); -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) if (class_device_create_file(&btv->video_dev->class_dev, &class_device_attr_card)<0) { printk(KERN_ERR "bttv%d: class_device_create_file 'card' " "failed\n", btv->c.nr); goto err; } -#endif /* vbi */ btv->vbi_dev = vdev_init(btv, &bttv_vbi_template, "vbi"); -- cgit v1.2.3