diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2011-02-13 09:53:34 +0300 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2011-02-13 09:53:34 +0300 |
commit | c170093d31bd4e3bc51881cc0f123beeca7872c9 (patch) | |
tree | d93cd280d525dd339f33be010c75b7fd0bacd690 /drivers/media/video/v4l2-dev.c | |
parent | 557218e2d662574bc58d840fe116c7fd8d57aed8 (diff) | |
parent | 78bba987bc025a7263248501b453476e77b93331 (diff) | |
download | linux-c170093d31bd4e3bc51881cc0f123beeca7872c9.tar.xz |
Merge branch 'devicetree/merge' into spi/merge
Diffstat (limited to 'drivers/media/video/v4l2-dev.c')
-rw-r--r-- | drivers/media/video/v4l2-dev.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c index 359e23290a7e..341764a3a990 100644 --- a/drivers/media/video/v4l2-dev.c +++ b/drivers/media/video/v4l2-dev.c @@ -419,6 +419,10 @@ static int get_index(struct video_device *vdev) * The registration code assigns minor numbers and device node numbers * based on the requested type and registers the new device node with * the kernel. + * + * This function assumes that struct video_device was zeroed when it + * was allocated and does not contain any stale date. + * * An error is returned if no free minor or device node number could be * found, or if the registration of the device node failed. * @@ -440,7 +444,6 @@ static int __video_register_device(struct video_device *vdev, int type, int nr, int minor_offset = 0; int minor_cnt = VIDEO_NUM_DEVICES; const char *name_base; - void *priv = vdev->dev.p; /* A minor value of -1 marks this video device as never having been registered */ @@ -559,10 +562,6 @@ static int __video_register_device(struct video_device *vdev, int type, int nr, } /* Part 4: register the device with sysfs */ - memset(&vdev->dev, 0, sizeof(vdev->dev)); - /* The memset above cleared the device's device_private, so - put back the copy we made earlier. */ - vdev->dev.p = priv; vdev->dev.class = &video_class; vdev->dev.devt = MKDEV(VIDEO_MAJOR, vdev->minor); if (vdev->parent) |