summaryrefslogtreecommitdiff
path: root/linux/include
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2007-10-08 16:26:13 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-08 16:26:13 -0300
commit789d51c810626c90641912d4d260295be0b57d87 (patch)
treec391a3d06174a1f31ea7e3185cf9f75718631d2e /linux/include
parentbee12cc3dc8cc34a30ff03b084b809f5bfbb2217 (diff)
downloadmediapointer-dvb-s2-789d51c810626c90641912d4d260295be0b57d87.tar.gz
mediapointer-dvb-s2-789d51c810626c90641912d4d260295be0b57d87.tar.bz2
V4L: convert struct class_device to struct device
From: Kay Sievers <kay.sievers@vrfy.org> The currently used "struct class_device" will be removed from the kernel. Here is a patch that converts all users in drivers/media/video/ to struct device. Reviewed-by: Thierry Merle <thierry.merle@free.fr> Reviewed-by: Mike Isely <isely@pobox.com> Reviewed-by: Luca Risolia <luca.risolia@studio.unibo.it> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Diffstat (limited to 'linux/include')
-rw-r--r--linux/include/media/v4l2-dev.h28
1 files changed, 18 insertions, 10 deletions
diff --git a/linux/include/media/v4l2-dev.h b/linux/include/media/v4l2-dev.h
index 45dfc7a04..1b19da01c 100644
--- a/linux/include/media/v4l2-dev.h
+++ b/linux/include/media/v4l2-dev.h
@@ -96,10 +96,17 @@ struct video_device
struct file_operations *fops;
#endif
- /* device info */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
- struct device *dev;
+ /* sysfs */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13)
+ struct device class_dev; /* v4l device */
+#else
+ struct class_device class_dev;
#endif
+ struct device *dev; /* device parent */
+#endif
+
+ /* device info */
char name[32];
int type; /* v4l1 */
int type2; /* v4l2 */
@@ -358,9 +365,6 @@ void *priv;
#else
struct semaphore lock; /* ... helper function uses these */
#endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
- struct class_device class_dev; /* sysfs */
-#endif
};
/* Class-dev to video-device */
@@ -383,25 +387,29 @@ extern int video_usercopy(struct inode *inode, struct file *file,
int (*func)(struct inode *inode, struct file *file,
unsigned int cmd, void *arg));
-
#ifdef CONFIG_VIDEO_V4L1_COMPAT
#include <linux/mm.h>
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0)
static inline int __must_check
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13)
video_device_create_file(struct video_device *vfd,
struct class_device_attribute *attr)
+#else
+video_device_create_file(struct video_device *vfd,
+ struct device_attribute *attr)
+#endif
{
- int ret = class_device_create_file(&vfd->class_dev, attr);
+ int ret = device_create_file(&vfd->class_dev, attr);
if (ret < 0)
printk(KERN_WARNING "%s error: %d\n", __FUNCTION__, ret);
return ret;
}
static inline void
video_device_remove_file(struct video_device *vfd,
- struct class_device_attribute *attr)
+ struct device_attribute *attr)
{
- class_device_remove_file(&vfd->class_dev, attr);
+ device_remove_file(&vfd->class_dev, attr);
}
#endif