OSDN Git Service

media: tegra-video: Use zero crop settings if subdev has no get_selection
authorSowjanya Komatineni <skomatineni@nvidia.com>
Fri, 11 Dec 2020 17:02:30 +0000 (18:02 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 4 Jan 2021 11:53:14 +0000 (12:53 +0100)
commit56f64b82356b7494ca58d31652317c2f009d8ca1
tree0263b5b1a29bede314e82c898c704757afb34870
parent2ad100f359c28bed1b3bbca607a7c3e7ab684708
media: tegra-video: Use zero crop settings if subdev has no get_selection

Currently try format implementation doesn't check if subdevice has
get_selection ops implemented and returns -EINVAL on error from
direct v4l2_subdev_call of get_selection.

Selection API's are not mandatory for all V4L2 subdevices.

This patch fixes it by adding v4l2_subdev_has_ops check prior to
calling get_selection ops and continues with try or set format with
zero crop settings for subdevices that don't have get_selection and
returns -EINVAL only for subdevices that has get_selection ops.

Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/staging/media/tegra-video/vi.c