aboutsummaryrefslogtreecommitdiffstats
path: root/include/media/v4l2-dev.h
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2007-10-08 15:26:13 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-09 23:03:14 -0400
commit54bd5b66c87d14e250f108aad1228b905d6882f6 (patch)
tree2ecb78046819e2c9da176a74e4e9fbc8097031be /include/media/v4l2-dev.h
parentd4cae5a50021271b9ef4e5e39e71e177d12fa8cb (diff)
V4L/DVB (6293): V4L: convert struct class_device to struct device
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> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'include/media/v4l2-dev.h')
-rw-r--r--include/media/v4l2-dev.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h
index 8b79e2cf77fa..e75d5e6c4cea 100644
--- a/include/media/v4l2-dev.h
+++ b/include/media/v4l2-dev.h
@@ -86,8 +86,11 @@ struct video_device
86 /* device ops */ 86 /* device ops */
87 const struct file_operations *fops; 87 const struct file_operations *fops;
88 88
89 /* sysfs */
90 struct device class_dev; /* v4l device */
91 struct device *dev; /* device parent */
92
89 /* device info */ 93 /* device info */
90 struct device *dev;
91 char name[32]; 94 char name[32];
92 int type; /* v4l1 */ 95 int type; /* v4l1 */
93 int type2; /* v4l2 */ 96 int type2; /* v4l2 */
@@ -332,7 +335,6 @@ void *priv;
332 /* for videodev.c intenal usage -- please don't touch */ 335 /* for videodev.c intenal usage -- please don't touch */
333 int users; /* video_exclusive_{open|close} ... */ 336 int users; /* video_exclusive_{open|close} ... */
334 struct mutex lock; /* ... helper function uses these */ 337 struct mutex lock; /* ... helper function uses these */
335 struct class_device class_dev; /* sysfs */
336}; 338};
337 339
338/* Class-dev to video-device */ 340/* Class-dev to video-device */
@@ -360,18 +362,18 @@ extern int video_usercopy(struct inode *inode, struct file *file,
360 362
361static inline int __must_check 363static inline int __must_check
362video_device_create_file(struct video_device *vfd, 364video_device_create_file(struct video_device *vfd,
363 struct class_device_attribute *attr) 365 struct device_attribute *attr)
364{ 366{
365 int ret = class_device_create_file(&vfd->class_dev, attr); 367 int ret = device_create_file(&vfd->class_dev, attr);
366 if (ret < 0) 368 if (ret < 0)
367 printk(KERN_WARNING "%s error: %d\n", __FUNCTION__, ret); 369 printk(KERN_WARNING "%s error: %d\n", __FUNCTION__, ret);
368 return ret; 370 return ret;
369} 371}
370static inline void 372static inline void
371video_device_remove_file(struct video_device *vfd, 373video_device_remove_file(struct video_device *vfd,
372 struct class_device_attribute *attr) 374 struct device_attribute *attr)
373{ 375{
374 class_device_remove_file(&vfd->class_dev, attr); 376 device_remove_file(&vfd->class_dev, attr);
375} 377}
376 378
377#endif /* CONFIG_VIDEO_V4L1_COMPAT */ 379#endif /* CONFIG_VIDEO_V4L1_COMPAT */