summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-08-24 16:18:47 +0200
committerHans Verkuil <hverkuil@xs4all.nl>2008-08-24 16:18:47 +0200
commit2816d7977bb65f823645607fa0a052e640d518fa (patch)
tree6a2029257ec85c93e3781f72adc2ee236be48f7b /linux/drivers
parentf53b09dad8e22d19c98a9c136dcfd35dbd09428a (diff)
downloadmediapointer-dvb-s2-2816d7977bb65f823645607fa0a052e640d518fa.tar.gz
mediapointer-dvb-s2-2816d7977bb65f823645607fa0a052e640d518fa.tar.bz2
v4l2-dev: do not clear the driver_data field
From: Hans Verkuil <hverkuil@xs4all.nl> 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. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'linux/drivers')
-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)