summaryrefslogtreecommitdiff
path: root/drivers/media/i2c/ov7740.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2019-07-17 12:24:13 +0300
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-07-23 18:47:09 +0300
commit2dbcb6fb96f5faca146279d5fc8a3c7b803b25cb (patch)
tree2440c06e66e8638b0cbd1240c5cff3ab905f8c85 /drivers/media/i2c/ov7740.c
parent596a5a58e89a4bfe0d8a275ab552de990b18f0ac (diff)
downloadlinux-2dbcb6fb96f5faca146279d5fc8a3c7b803b25cb.tar.xz
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>
Diffstat (limited to 'drivers/media/i2c/ov7740.c')
-rw-r--r--drivers/media/i2c/ov7740.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/media/i2c/ov7740.c b/drivers/media/i2c/ov7740.c
index 70bb870b1d08..a2f8f19bca7c 100644
--- a/drivers/media/i2c/ov7740.c
+++ b/drivers/media/i2c/ov7740.c
@@ -827,13 +827,9 @@ static int ov7740_set_fmt(struct v4l2_subdev *sd,
#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
mbus_fmt = v4l2_subdev_get_try_format(sd, cfg, format->pad);
*mbus_fmt = format->format;
-
+#endif
mutex_unlock(&ov7740->mutex);
return 0;
-#else
- ret = -ENOTTY;
- goto error;
-#endif
}
ret = ov7740_try_fmt_internal(sd, &format->format, &ovfmt, &fsize);
@@ -868,7 +864,7 @@ static int ov7740_get_fmt(struct v4l2_subdev *sd,
format->format = *mbus_fmt;
ret = 0;
#else
- ret = -ENOTTY;
+ ret = -EINVAL;
#endif
} else {
format->format = ov7740->format;