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>
This commit is contained in:
Kay Sievers
2007-10-08 16:26:13 -03:00
committed by Mauro Carvalho Chehab
parent d4cae5a500
commit 54bd5b66c8
10 changed files with 387 additions and 340 deletions

View File

@@ -86,8 +86,11 @@ struct video_device
/* device ops */
const struct file_operations *fops;
/* sysfs */
struct device class_dev; /* v4l device */
struct device *dev; /* device parent */
/* device info */
struct device *dev;
char name[32];
int type; /* v4l1 */
int type2; /* v4l2 */
@@ -332,7 +335,6 @@ void *priv;
/* for videodev.c intenal usage -- please don't touch */
int users; /* video_exclusive_{open|close} ... */
struct mutex lock; /* ... helper function uses these */
struct class_device class_dev; /* sysfs */
};
/* Class-dev to video-device */
@@ -360,18 +362,18 @@ extern int video_usercopy(struct inode *inode, struct file *file,
static inline int __must_check
video_device_create_file(struct video_device *vfd,
struct class_device_attribute *attr)
struct device_attribute *attr)
{
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 /* CONFIG_VIDEO_V4L1_COMPAT */