summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/videodev.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/videodev.c')
-rw-r--r--linux/drivers/media/video/videodev.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/linux/drivers/media/video/videodev.c b/linux/drivers/media/video/videodev.c
index 7ac11d5fb..a3010740a 100644
--- a/linux/drivers/media/video/videodev.c
+++ b/linux/drivers/media/video/videodev.c
@@ -457,7 +457,7 @@ static int video_open(struct inode *inode, struct file *file)
unsigned int minor = iminor(inode);
int err = 0;
struct video_device *vfl;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 17)
const struct file_operations *old_fops;
#else
struct file_operations *old_fops;
@@ -478,7 +478,11 @@ static int video_open(struct inode *inode, struct file *file)
}
}
old_fops = file->f_op;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 17)
file->f_op = fops_get(vfl->fops);
+#else
+ file->f_op = (struct file_operations *)fops_get(vfl->fops);
+#endif
if(file->f_op->open)
err = file->f_op->open(inode,file);
if (err) {
@@ -2265,7 +2269,12 @@ static int __init videodev_init(void)
int ret;
printk(KERN_INFO "Linux video capture interface: v2.00\n");
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 17)
if (register_chrdev(VIDEO_MAJOR, VIDEO_NAME, &video_fops)) {
+#else
+ if (register_chrdev(VIDEO_MAJOR, VIDEO_NAME,
+ (struct file_operations *)&video_fops)) {
+#endif
printk(KERN_WARNING "video_dev: unable to get major %d\n", VIDEO_MAJOR);
return -EIO;
}