Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c431cbbb authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

Revert "[media] v4l2-ioctl: simplify code"



There are some issues rised on this patch during patch review.
I ended by merging this one by mistake. So, let's revert it.

This reverts commit 54ace1cf.

Cc: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 6ad9ba9c
Loading
Loading
Loading
Loading
+22 −29
Original line number Diff line number Diff line
@@ -2160,19 +2160,11 @@ static int v4l_cropcap(const struct v4l2_ioctl_ops *ops,
				struct file *file, void *fh, void *arg)
{
	struct v4l2_cropcap *p = arg;

	if (ops->vidioc_g_selection) {
		struct v4l2_selection s = { .type = p->type };
		int ret;

	if (ops->vidioc_g_selection == NULL) {
		/*
		 * The determine_valid_ioctls() call already should ensure
		 * that ops->vidioc_cropcap != NULL, but just in case...
		 */
		if (ops->vidioc_cropcap)
			return ops->vidioc_cropcap(file, fh, p);
		return -ENOTTY;
	}

		/* obtaining bounds */
		if (V4L2_TYPE_IS_OUTPUT(p->type))
			s.target = V4L2_SEL_TGT_COMPOSE_BOUNDS;
@@ -2194,6 +2186,7 @@ static int v4l_cropcap(const struct v4l2_ioctl_ops *ops,
		if (ret)
			return ret;
		p->defrect = s.r;
	}

	/* setting trivial pixelaspect */
	p->pixelaspect.numerator = 1;