Hi Sylwester,
On Sun, Jun 18, 2017 at 10:53:48PM +0200, Sylwester Nawrocki wrote:
> >> + */
> >> +static int v4l_g_selection(const struct v4l2_ioctl_ops *ops,
> >> + struct file *file, void *fh, void *arg)
> >> +{
> >> + struct v4l2_selection *p = arg;
> >> + u32 old_type = p->type;
> >> + int ret;
> >> +
> >> + if (p->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)
> >> + p->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
> >> + else if (p->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
> >> + p->type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
> >> + ret = ops->vidioc_g_selection(file, fh, p);
> >> + p->type = old_type;
> >> + return ret;
> >> +}
> >> +
> >> +static int v4l_s_selection(const struct v4l2_ioctl_ops *ops,
> >> + struct file *file, void *fh, void *arg)
> >> +{
> >> + struct v4l2_selection *p = arg;
> >> + u32 old_type = p->type;
> >> + int ret;
> >> +
> >> + if (p->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)
> >> + p->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
> >> + else if (p->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
> >> + p->type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
> >> + ret = ops->vidioc_s_selection(file, fh, p);
> >
> > Can it be that ops->vidioc_s_selection() is NULL here? I don't think it's
> > checked anywhere. Same in v4l_g_selection().
>
> I think it can't be, there is the valid_ioctls bitmap test before a call back
> to the driver, to see if driver actually implements an ioctl. And the bitmap
> is populated beforehand in determine_valid_ioctls().
Ack. Looks good to me then.
Acked-by: Sakari Ailus <[email protected]>
--
Sakari Ailus
e-mail: [email protected] XMPP: [email protected]