summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/v4l2-dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/v4l2-dev.c')
-rw-r--r--linux/drivers/media/video/v4l2-dev.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/linux/drivers/media/video/v4l2-dev.c b/linux/drivers/media/video/v4l2-dev.c
index 37b9a5076..a244c1296 100644
--- a/linux/drivers/media/video/v4l2-dev.c
+++ b/linux/drivers/media/video/v4l2-dev.c
@@ -266,6 +266,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);
@@ -332,6 +333,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 LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19)