All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe De Muyter <phdm@macqel.be>
To: linux-media@vger.kernel.org, slongerbeam@gmail.com
Cc: Philippe De Muyter <phdm@macqel.be>
Subject: [PATCH v3 2/2] media: imx: capture: use 'v4l2_fill_frmivalenum_from_subdev'
Date: Tue, 11 Sep 2018 19:06:33 +0200	[thread overview]
Message-ID: <1536685593-27512-3-git-send-email-phdm@macqel.be> (raw)
In-Reply-To: <1536685593-27512-1-git-send-email-phdm@macqel.be>

---
 drivers/staging/media/imx/imx-media-capture.c | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/drivers/staging/media/imx/imx-media-capture.c b/drivers/staging/media/imx/imx-media-capture.c
index 256039c..688dd7a 100644
--- a/drivers/staging/media/imx/imx-media-capture.c
+++ b/drivers/staging/media/imx/imx-media-capture.c
@@ -126,28 +126,12 @@ static int capture_enum_frameintervals(struct file *file, void *fh,
 {
 	struct capture_priv *priv = video_drvdata(file);
 	const struct imx_media_pixfmt *cc;
-	struct v4l2_subdev_frame_interval_enum fie = {
-		.index = fival->index,
-		.pad = priv->src_sd_pad,
-		.width = fival->width,
-		.height = fival->height,
-		.which = V4L2_SUBDEV_FORMAT_ACTIVE,
-	};
-	int ret;
 
 	cc = imx_media_find_format(fival->pixel_format, CS_SEL_ANY, true);
 	if (!cc)
 		return -EINVAL;
 
-	fie.code = cc->codes[0];
-
-	ret = v4l2_subdev_call(priv->src_sd, pad, enum_frame_interval,
-			       NULL, &fie);
-	if (ret)
-		return ret;
-
-	fival->type = V4L2_FRMIVAL_TYPE_DISCRETE;
-	fival->discrete = fie.interval;
+	return v4l2_fill_frmivalenum_from_subdev(priv->src_sd, fival, cc->codes[0]);
 
 	return 0;
 }
-- 
1.8.4

      parent reply	other threads:[~2018-09-11 22:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <linux-media@vger.kernel.org.slongerbeam@gmail.com>
2018-09-11 17:06 ` [PATCH v3 0/2] media: v4l2-subdev.h: allow V4L2_FRMIVAL_TYPE_CONTINUOUS & _STEPWISE Philippe De Muyter
2018-09-11 17:06   ` [PATCH v3 1/2] " Philippe De Muyter
2018-09-20 14:11     ` Laurent Pinchart
2018-09-20 15:15       ` Philippe De Muyter
2018-09-11 17:06   ` Philippe De Muyter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1536685593-27512-3-git-send-email-phdm@macqel.be \
    --to=phdm@macqel.be \
    --cc=linux-media@vger.kernel.org \
    --cc=slongerbeam@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.