[media] v4l2: always require v4l2_dev, rename parent to dev_parent
authorHans Verkuil <hans.verkuil@cisco.com>
Wed, 12 Jun 2013 14:15:12 +0000 (11:15 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 21 Jun 2013 14:07:12 +0000 (11:07 -0300)
commit1c1d86a1ea07506c070cfb217a009d53990bdeb0
tree49396011dd6c6eedaf2b1d3f009f63ca5aed78a0
parentd481c581dfe43be11a17728b5c84c2d4b5beecb2
[media] v4l2: always require v4l2_dev, rename parent to dev_parent

The last set of drivers still using the parent field of video_device instead
of the v4l2_dev field have been converted, so v4l2_dev is now always set.
A proper pointer to v4l2_dev is necessary these days otherwise the advanced
debugging ioctls will not work when addressing sub-devices. It also ensures
that the core can always go from a video_device struct to the top-level
v4l2_device struct.
There is still one single use case for the parent pointer: if there are
multiple busses, each being the parent of one or more video nodes, and if
they all share the same v4l2_device struct. In that case one still needs a
parent pointer since the v4l2_device struct can only refer to a single
parent device. The cx88 driver is one such case. Unfortunately, the cx88
failed to set the parent pointer since 3.6. The next patch will correct this.
In order to support this use-case the parent pointer is only renamed to
dev_parent, not removed altogether. It has been renamed to ensure that the
compiler will catch any (possibly out-of-tree) drivers that were missed during
the conversion.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/v4l2-core/v4l2-dev.c
drivers/media/v4l2-core/v4l2-ioctl.c
include/media/v4l2-dev.h