linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Niklas Söderlund" <niklas.soderlund@ragnatech.se>
To: linux-media@vger.kernel.org, ulrich.hecht@gmail.com, hverkuil@xs4all.nl
Cc: linux-renesas-soc@vger.kernel.org,
	"Ulrich Hecht" <ulrich.hecht+renesas@gmail.com>,
	"William Towle" <william.towle@codethink.co.uk>,
	"Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
Subject: [PATCH 2/8] media: rcar_vin: Use correct pad number in try_fmt
Date: Wed, 25 May 2016 21:10:03 +0200	[thread overview]
Message-ID: <1464203409-1279-3-git-send-email-niklas.soderlund@ragnatech.se> (raw)
In-Reply-To: <1464203409-1279-1-git-send-email-niklas.soderlund@ragnatech.se>

From: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>

Fix rcar_vin_try_fmt's use of an inappropriate pad number when calling
the subdev set_fmt function - for the ADV7612, IDs should be non-zero.

Signed-off-by: William Towle <william.towle@codethink.co.uk>
Reviewed-by: Rob Taylor <rob.taylor@codethink.co.uk>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
[uli: adapted to rcar-vin rewrite]
Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 drivers/media/platform/rcar-vin/rcar-v4l2.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c
index 929816b..3788f8a 100644
--- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
+++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
@@ -98,7 +98,7 @@ static int __rvin_try_format_source(struct rvin_dev *vin,
 					struct rvin_source_fmt *source)
 {
 	struct v4l2_subdev *sd;
-	struct v4l2_subdev_pad_config pad_cfg;
+	struct v4l2_subdev_pad_config *pad_cfg;
 	struct v4l2_subdev_format format = {
 		.which = which,
 	};
@@ -108,10 +108,16 @@ static int __rvin_try_format_source(struct rvin_dev *vin,
 
 	v4l2_fill_mbus_format(&format.format, pix, vin->source.code);
 
+	pad_cfg = v4l2_subdev_alloc_pad_config(sd);
+	if (pad_cfg == NULL)
+		return -ENOMEM;
+
+	format.pad = vin->src_pad_idx;
+
 	ret = v4l2_device_call_until_err(sd->v4l2_dev, 0, pad, set_fmt,
-					 &pad_cfg, &format);
+					 pad_cfg, &format);
 	if (ret < 0)
-		return ret;
+		goto cleanup;
 
 	v4l2_fill_pix_format(pix, &format.format);
 
@@ -121,6 +127,8 @@ static int __rvin_try_format_source(struct rvin_dev *vin,
 	vin_dbg(vin, "Source resolution: %ux%u\n", source->width,
 		source->height);
 
+cleanup:
+	v4l2_subdev_free_pad_config(pad_cfg);
 	return 0;
 }
 
-- 
2.8.2


  parent reply	other threads:[~2016-05-25 19:19 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-25 19:10 [PATCH 0/8] rcar-vin: Enable Gen3 support Niklas Söderlund
2016-05-25 19:10 ` [PATCH 1/8] media: rcar-vin: pad-aware driver initialisation Niklas Söderlund
2016-06-16 14:56   ` Laurent Pinchart
2016-05-25 19:10 ` Niklas Söderlund [this message]
2016-06-16 14:56   ` [PATCH 2/8] media: rcar_vin: Use correct pad number in try_fmt Laurent Pinchart
2016-05-25 19:10 ` [PATCH 3/8] media: rcar-vin: add DV timings support Niklas Söderlund
2016-06-16 15:05   ` Laurent Pinchart
2016-05-25 19:10 ` [PATCH 4/8] [media] rcar-vin: allow subdevices to be bound late Niklas Söderlund
2016-05-25 19:10 ` [PATCH 5/8] [media] rcar-vin: add Gen3 HW registers Niklas Söderlund
2016-06-16 16:52   ` Laurent Pinchart
2016-05-25 19:10 ` [PATCH 6/8] [media] rcar-vin: add shared subdevice groups Niklas Söderlund
2016-05-25 19:10 ` [PATCH 7/8] [media] rcar-vin: enable Gen3 Niklas Söderlund
2016-06-16 16:55   ` Laurent Pinchart
2016-05-25 19:10 ` [PATCH 8/8] [media] rcar-vin: add Gen2 and Gen3 fallback compatibility strings Niklas Söderlund
2016-05-25 19:36   ` Sergei Shtylyov
2016-05-27 11:36     ` Niklas Söderlund
2016-05-27 18:18       ` Sergei Shtylyov
2016-06-16 16:55   ` Laurent Pinchart

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=1464203409-1279-3-git-send-email-niklas.soderlund@ragnatech.se \
    --to=niklas.soderlund@ragnatech.se \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=niklas.soderlund+renesas@ragnatech.se \
    --cc=ulrich.hecht+renesas@gmail.com \
    --cc=ulrich.hecht@gmail.com \
    --cc=william.towle@codethink.co.uk \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).