Hi Hans,
On Mon, Mar 06, 2017 at 03:56:04PM +0100, Hans Verkuil wrote:
> From: Hans Verkuil
>
> Drop unnecesary memset. Drop the unnecessary extendedmode check and
> set the V4L2_CAP_TIMEPERFRAME capability.
>
> Signed-off-by: Hans Verkuil
> ---
> drivers/media/i2c/ov7670.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c
> index 9af8d3b8f848..50e4466a2b37 100644
> --- a/drivers/media/i2c/ov7670.c
> +++ b/drivers/media/i2c/ov7670.c
> @@ -1046,7 +1046,6 @@ static int ov7670_g_parm(struct v4l2_subdev *sd, struct
> v4l2_streamparm *parms)
> if (parms->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
> return -EINVAL;
>
> - memset(cp, 0, sizeof(struct v4l2_captureparm));
> cp->capability = V4L2_CAP_TIMEPERFRAME;
> info->devtype->get_framerate(sd, >timeperframe);
>
> @@ -1061,9 +1060,8 @@ static int ov7670_s_parm(struct v4l2_subdev *sd, struct
> v4l2_streamparm *parms)
>
> if (parms->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
> return -EINVAL;
> - if (cp->extendedmode != 0)
> - return -EINVAL;
>
> + cp->capability = V4L2_CAP_TIMEPERFRAME;
> return info->devtype->set_framerate(sd, tpf);
> }
>
We seem to have two ways to specify the frame interval for sub-devices,
with roughly roughly similar number of users. s_parm() originates from
drivers that typically work on plain V4L2 interfaces whereas
s_frame_interval() is from native sub-device drivers.
Anyway,
Acked-by: Sakari Ailus
--
Sakari Ailus
e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.uk