summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--linux/drivers/media/video/bt8xx/bttv-driver.c4
-rw-r--r--v4l/compat.h5
2 files changed, 6 insertions, 3 deletions
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");
diff --git a/v4l/compat.h b/v4l/compat.h
index 08ac828d6..9918f2e46 100644
--- a/v4l/compat.h
+++ b/v4l/compat.h
@@ -249,6 +249,11 @@ static inline unsigned long vmalloc_to_pfn(void * vmalloc_addr)
#endif
#endif
+/* The class_device system didn't appear until 2.5.69 */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
+#define class_device_create_file(a, b) (0)
+#endif
+
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13)
# define class_device_create(a, b, c, d, e, f, g, h) class_simple_device_add(a, c, d, e, f, g, h)
# define class_device_destroy(a, b) class_simple_device_remove(b)