mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-15 07:04:44 +00:00
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>
This commit is contained in:
parent
c170ecf434
commit
9d95af9d09
1 changed files with 4 additions and 0 deletions
|
@ -226,6 +226,7 @@ int video_register_device_index(struct video_device *vfd, int type, int nr,
|
||||||
int end;
|
int end;
|
||||||
int ret;
|
int ret;
|
||||||
char *name_base;
|
char *name_base;
|
||||||
|
void *priv = video_get_drvdata(vfd);
|
||||||
|
|
||||||
/* the release callback MUST be present */
|
/* the release callback MUST be present */
|
||||||
BUG_ON(!vfd->release);
|
BUG_ON(!vfd->release);
|
||||||
|
@ -295,6 +296,9 @@ int video_register_device_index(struct video_device *vfd, int type, int nr,
|
||||||
|
|
||||||
/* sysfs class */
|
/* sysfs class */
|
||||||
memset(&vfd->dev, 0, sizeof(vfd->dev));
|
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.class = &video_class;
|
||||||
vfd->dev.devt = MKDEV(VIDEO_MAJOR, vfd->minor);
|
vfd->dev.devt = MKDEV(VIDEO_MAJOR, vfd->minor);
|
||||||
if (vfd->parent)
|
if (vfd->parent)
|
||||||
|
|
Loading…
Reference in a new issue