mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rishikesh Donadkar <r-donadkar@ti.com>
To: <jai.luthra@linux.dev>
Cc: <r-donadkar@ti.com>, <y-abhilashchandra@ti.com>,
	<devarsht@ti.com>, <vigneshr@ti.com>, <mchehab@kernel.org>,
	<tomi.valkeinen@ideasonboard.com>, <jai.luthra@ideasonboard.com>,
	<linux-kernel@vger.kernel.org>, <linux-media@vger.kernel.org>
Subject: [PATCH 3/4] media: i2c: ds90ub960: Fix VC mapping when ports skipped
Date: Mon, 8 Jun 2026 19:59:00 +0530	[thread overview]
Message-ID: <20260608142901.3971821-4-r-donadkar@ti.com> (raw)
In-Reply-To: <20260608142901.3971821-1-r-donadkar@ti.com>

From: Jai Luthra <j-luthra@ti.com>

Currently the for loop that maps virtual channels from RX to TX ports
terminates at the first unconnected RX port.

Fix that by instead continuing to scan the remaining ports.

Signed-off-by: Jai Luthra <j-luthra@ti.com>
Signed-off-by: Rishikesh Donadkar <r-donadkar@ti.com>
---
 drivers/media/i2c/ds90ub960.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/media/i2c/ds90ub960.c b/drivers/media/i2c/ds90ub960.c
index 506b436fe50c..d1597659639f 100644
--- a/drivers/media/i2c/ds90ub960.c
+++ b/drivers/media/i2c/ds90ub960.c
@@ -3488,15 +3488,16 @@ static void ub960_get_vc_maps(struct ub960_data *priv, u8 *vc_map)
 	struct device *dev = &priv->client->dev;
 	u8 nport, available_vc = 0;
 
-	for (nport = 0;
-	     nport < priv->hw_data->num_rxports && priv->rxports[nport];
-	     ++nport) {
+	for (nport = 0; nport < priv->hw_data->num_rxports; ++nport) {
 		struct v4l2_mbus_frame_desc source_fd;
 		bool used_vc[UB960_MAX_VC] = {false};
 		u8 vc, cur_vc = available_vc;
 		int j, ret;
 		u8 map;
 
+		if (!priv->rxports[nport])
+			continue;
+
 		ret = v4l2_subdev_call(priv->rxports[nport]->source.sd, pad,
 				       get_frame_desc,
 				       priv->rxports[nport]->source.pad,
-- 
2.34.1


  parent reply	other threads:[~2026-06-08 14:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-08 14:28 [PATCH 0/4] media: i2c: ds90ub960: VC mapping improvements and TX1 support Rishikesh Donadkar
2026-06-08 14:28 ` [PATCH 1/4] media: i2c: ds90ub960: Enable CSI TX1 port Rishikesh Donadkar
2026-06-08 14:28 ` [PATCH 2/4] media: i2c: ds90ub960: Support multi-channel sensors Rishikesh Donadkar
2026-06-08 17:09   ` Jai Luthra
2026-06-08 14:29 ` Rishikesh Donadkar [this message]
2026-06-08 17:11   ` [PATCH 3/4] media: i2c: ds90ub960: Fix VC mapping when ports skipped Jai Luthra
2026-06-08 14:29 ` [PATCH 4/4] media: i2c: ds90ub960: Use VC mapping specific to ub9702 Rishikesh Donadkar
2026-06-08 17:16   ` Jai Luthra

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=20260608142901.3971821-4-r-donadkar@ti.com \
    --to=r-donadkar@ti.com \
    --cc=devarsht@ti.com \
    --cc=jai.luthra@ideasonboard.com \
    --cc=jai.luthra@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=tomi.valkeinen@ideasonboard.com \
    --cc=vigneshr@ti.com \
    --cc=y-abhilashchandra@ti.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®