aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/video/v4l2-dev.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-08-24 11:18:47 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-12 09:36:54 -0200
commit9d95af9d09d537d287eea9914c0d1ca4cfa0ec7f (patch)
tree33fa1c6fb5aed9a056cc5baec7f9b8c70654d45e /drivers/media/video/v4l2-dev.c
parentc170ecf434bceb0e188b14a6deb3bfa3ec9ef699 (diff)
V4L/DVB (8791): v4l2-dev: do not clear the driver_data field
The driver_data field of the device structure was zeroed, thus losing this information. Many drivers set this up before calling video_device_register, so we have to ensure that it isn't lost. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/v4l2-dev.c')
-rw-r--r--drivers/media/video/v4l2-dev.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c
index 1ec0a1a8fb7..99f7ee4bc50 100644
--- a/drivers/media/video/v4l2-dev.c
+++ b/drivers/media/video/v4l2-dev.c
@@ -226,6 +226,7 @@ int video_register_device_index(struct video_device *vfd, int type, int nr,
int end;
int ret;
char *name_base;
+ void *priv = video_get_drvdata(vfd);
/* the release callback MUST be present */
BUG_ON(!vfd->release);
@@ -295,6 +296,9 @@ int video_register_device_index(struct video_device *vfd, int type, int nr,
/* sysfs class */
memset(&vfd->dev, 0, sizeof(vfd->dev));
+ /* The memset above cleared the device's drvdata, so
+ put back the copy we made earlier. */
+ video_set_drvdata(vfd, priv);
vfd->dev.class = &video_class;
vfd->dev.devt = MKDEV(VIDEO_MAJOR, vfd->minor);
if (vfd->parent)