summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-07-17 16:48:19 +0200
committerHans Verkuil <hverkuil@xs4all.nl>2008-07-17 16:48:19 +0200
commit7b7b6e145e1bf05cdf3e5d82e8f30b288ad9e15a (patch)
treeecd9ae302f0c652aca56f7716b26d143c475b686 /linux
parent3d482117ca1f1846a019f59f91466eb5f3306671 (diff)
downloadmediapointer-dvb-s2-7b7b6e145e1bf05cdf3e5d82e8f30b288ad9e15a.tar.gz
mediapointer-dvb-s2-7b7b6e145e1bf05cdf3e5d82e8f30b288ad9e15a.tar.bz2
videodev/dabusb/dvbdev: fix 2.6.16 compilation
From: Hans Verkuil <hverkuil@xs4all.nl> struct file_operations was made const in 2.6.17. Cast const away when compiling under 2.6.16. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvbdev.c5
-rw-r--r--linux/drivers/media/video/dabusb.c4
-rw-r--r--linux/drivers/media/video/videodev.c11
-rw-r--r--linux/include/media/v4l2-dev.h4
4 files changed, 19 insertions, 5 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/dvbdev.c b/linux/drivers/media/dvb/dvb-core/dvbdev.c
index 0ae0e5852..3210b938b 100644
--- a/linux/drivers/media/dvb/dvb-core/dvbdev.c
+++ b/linux/drivers/media/dvb/dvb-core/dvbdev.c
@@ -425,7 +425,12 @@ static int __init init_dvbdev(void)
return retval;
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 17)
cdev_init(&dvb_device_cdev, &dvb_device_fops);
+#else
+ cdev_init(&dvb_device_cdev,
+ (struct file_operations *)&dvb_device_fops);
+#endif
if ((retval = cdev_add(&dvb_device_cdev, dev, MAX_DVB_MINORS)) != 0) {
printk(KERN_ERR "dvb-core: unable register character device\n");
goto error;
diff --git a/linux/drivers/media/video/dabusb.c b/linux/drivers/media/video/dabusb.c
index 4efe3f839..72bf5868c 100644
--- a/linux/drivers/media/video/dabusb.c
+++ b/linux/drivers/media/video/dabusb.c
@@ -700,7 +700,11 @@ static int dabusb_ioctl (struct inode *inode, struct file *file, unsigned int cm
return ret;
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 17)
static const struct file_operations dabusb_fops =
+#else
+static struct file_operations dabusb_fops =
+#endif
{
.owner = THIS_MODULE,
.llseek = no_llseek,
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;
}
diff --git a/linux/include/media/v4l2-dev.h b/linux/include/media/v4l2-dev.h
index aa0fd8c94..2d68db550 100644
--- a/linux/include/media/v4l2-dev.h
+++ b/linux/include/media/v4l2-dev.h
@@ -85,11 +85,7 @@ extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd,
struct video_device
{
/* device ops */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17)
const struct file_operations *fops;
-#else
- struct file_operations *fops;
-#endif
/* sysfs */
struct device class_dev; /* v4l device */