Commit fa564e90 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

media: ov7670: 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: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 4965bcd3
...@@ -1110,10 +1110,8 @@ static int ov7670_set_fmt(struct v4l2_subdev *sd, ...@@ -1110,10 +1110,8 @@ static int ov7670_set_fmt(struct v4l2_subdev *sd,
#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API #ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
mbus_fmt = v4l2_subdev_get_try_format(sd, cfg, format->pad); mbus_fmt = v4l2_subdev_get_try_format(sd, cfg, format->pad);
*mbus_fmt = format->format; *mbus_fmt = format->format;
return 0;
#else
return -ENOTTY;
#endif #endif
return 0;
} }
ret = ov7670_try_fmt_internal(sd, &format->format, &info->fmt, &info->wsize); ret = ov7670_try_fmt_internal(sd, &format->format, &info->fmt, &info->wsize);
...@@ -1146,7 +1144,7 @@ static int ov7670_get_fmt(struct v4l2_subdev *sd, ...@@ -1146,7 +1144,7 @@ static int ov7670_get_fmt(struct v4l2_subdev *sd,
format->format = *mbus_fmt; format->format = *mbus_fmt;
return 0; return 0;
#else #else
return -ENOTTY; return -EINVAL;
#endif #endif
} else { } else {
format->format = info->format; format->format = info->format;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment