summaryrefslogtreecommitdiff
path: root/drivers/media/video/v4l2-dev.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-07-20 13:35:02 +0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-23 23:42:52 +0400
commit22a04f106346c3af019135f2de3cabf9ac41c3ba (patch)
tree520b5260c3883f153cb55192f7df92899fbd062e /drivers/media/video/v4l2-dev.c
parent5e85e732f0ed56aa97a3ba26ac2b93ffe597a208 (diff)
downloadlinux-22a04f106346c3af019135f2de3cabf9ac41c3ba.tar.xz
V4L/DVB (8429): videodev: renamed 'class_dev' to 'dev'
The class_dev field is a normal device, not a class device. This is very confusing and now that the old 'dev' field has been renamed to 'parent' we can rename 'class_dev' to just 'dev'. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/v4l2-dev.c')
-rw-r--r--drivers/media/video/v4l2-dev.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c
index 9cc2cf1a1c93..88eeee1d8baf 100644
--- a/drivers/media/video/v4l2-dev.c
+++ b/drivers/media/video/v4l2-dev.c
@@ -41,16 +41,14 @@
static ssize_t show_index(struct device *cd,
struct device_attribute *attr, char *buf)
{
- struct video_device *vfd = container_of(cd, struct video_device,
- class_dev);
+ struct video_device *vfd = container_of(cd, struct video_device, dev);
return sprintf(buf, "%i\n", vfd->index);
}
static ssize_t show_name(struct device *cd,
struct device_attribute *attr, char *buf)
{
- struct video_device *vfd = container_of(cd, struct video_device,
- class_dev);
+ struct video_device *vfd = container_of(cd, struct video_device, dev);
return sprintf(buf, "%.*s\n", (int)sizeof(vfd->name), vfd->name);
}
@@ -77,8 +75,7 @@ EXPORT_SYMBOL(video_device_release);
static void video_release(struct device *cd)
{
- struct video_device *vfd = container_of(cd, struct video_device,
- class_dev);
+ struct video_device *vfd = container_of(cd, struct video_device, dev);
#if 1
/* needed until all drivers are fixed */
@@ -320,13 +317,13 @@ int video_register_device_index(struct video_device *vfd, int type, int nr,
mutex_init(&vfd->lock);
/* sysfs class */
- memset(&vfd->class_dev, 0x00, sizeof(vfd->class_dev));
- vfd->class_dev.class = &video_class;
- vfd->class_dev.devt = MKDEV(VIDEO_MAJOR, vfd->minor);
+ memset(&vfd->dev, 0x00, sizeof(vfd->dev));
+ vfd->dev.class = &video_class;
+ vfd->dev.devt = MKDEV(VIDEO_MAJOR, vfd->minor);
if (vfd->parent)
- vfd->class_dev.parent = vfd->parent;
- sprintf(vfd->class_dev.bus_id, "%s%d", name_base, i - base);
- ret = device_register(&vfd->class_dev);
+ vfd->dev.parent = vfd->parent;
+ sprintf(vfd->dev.bus_id, "%s%d", name_base, i - base);
+ ret = device_register(&vfd->dev);
if (ret < 0) {
printk(KERN_ERR "%s: device_register failed\n", __func__);
goto fail_minor;
@@ -365,7 +362,7 @@ void video_unregister_device(struct video_device *vfd)
panic("videodev: bad unregister");
video_device[vfd->minor] = NULL;
- device_unregister(&vfd->class_dev);
+ device_unregister(&vfd->dev);
mutex_unlock(&videodev_lock);
}
EXPORT_SYMBOL(video_unregister_device);