• Hans Verkuil's avatar
    [media] v4l2: always require v4l2_dev, rename parent to dev_parent · 1c1d86a1
    Hans Verkuil authored
    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: default avatarHans Verkuil <hans.verkuil@cisco.com>
    Acked-by: default avatarSakari Ailus <sakari.ailus@iki.fi>
    Acked-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
    1c1d86a1
v4l2-dev.c 31 KB