media: media/i2c: don't return ENOTTY if SUBDEV_API is not set
commit2dbcb6fb96f5faca146279d5fc8a3c7b803b25cb
authorHans Verkuil <hverkuil@xs4all.nl>
Wed, 17 Jul 2019 09:24:13 +0000 (17 05:24 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 23 Jul 2019 15:47:09 +0000 (23 11:47 -0400)
tree2440c06e66e8638b0cbd1240c5cff3ab905f8c85
parent596a5a58e89a4bfe0d8a275ab552de990b18f0ac
media: media/i2c: don't return ENOTTY if SUBDEV_API is not set

If CONFIG_VIDEO_V4L2_SUBDEV_API is not set, then it is still possible
to call set_fmt for V4L2_SUBDEV_FORMAT_TRY, the result is just not
stored. So return 0 instead of -ENOTTY.

Calling get_fmt with V4L2_SUBDEV_FORMAT_TRY should return -EINVAL
instead of -ENOTTY, after all the get_fmt functionality is still
present, just not supported for TRY.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/i2c/mt9m111.c
drivers/media/i2c/ov2640.c
drivers/media/i2c/ov2659.c
drivers/media/i2c/ov2680.c
drivers/media/i2c/ov5695.c
drivers/media/i2c/ov7740.c