lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230614-topic-camss_grpah-v2-1-57d9d5e49038@linaro.org>
Date:   Sat, 15 Jul 2023 17:37:52 +0200
From:   Konrad Dybcio <konrad.dybcio@...aro.org>
To:     Robert Foss <rfoss@...nel.org>, Todor Tomov <todor.too@...il.com>,
        Bryan O'Donoghue <bryan.odonoghue@...aro.org>,
        Andy Gross <agross@...nel.org>,
        Bjorn Andersson <andersson@...nel.org>,
        Mauro Carvalho Chehab <mchehab@...nel.org>
Cc:     Marijn Suijten <marijn.suijten@...ainline.org>,
        Yassine Oudjana <y.oudjana@...tonmail.com>,
        linux-media@...r.kernel.org, linux-arm-msm@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Konrad Dybcio <konrad.dybcio@...aro.org>
Subject: [PATCH v2] media: camss: Intepret OF graph connections more
 sensibly

Not all endpoints of camss have to be populated. In fact, most of the
time they shouldn't be as n-th auxilliary cameras are usually ewaste.

Don't fail probing the entire camss even even one endpoint is not
linked and throw an error when none is found.

Signed-off-by: Konrad Dybcio <konrad.dybcio@...aro.org>
---
Changes in v2:
- Use if-else instead of the ternary operator (Bryan)
- Drop "RFC"
- Link to v1: https://lore.kernel.org/r/20230614-topic-camss_grpah-v1-1-5f4b516310fa@linaro.org
---
 drivers/media/platform/qcom/camss/camss.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
index 1ef26aea3eae..8b75197fa5d7 100644
--- a/drivers/media/platform/qcom/camss/camss.c
+++ b/drivers/media/platform/qcom/camss/camss.c
@@ -1084,9 +1084,8 @@ static int camss_of_parse_ports(struct camss *camss)
 
 		remote = of_graph_get_remote_port_parent(node);
 		if (!remote) {
-			dev_err(dev, "Cannot get remote parent\n");
-			ret = -EINVAL;
-			goto err_cleanup;
+			of_node_put(node);
+			continue;
 		}
 
 		csd = v4l2_async_nf_add_fwnode(&camss->notifier,
@@ -1105,7 +1104,10 @@ static int camss_of_parse_ports(struct camss *camss)
 		num_subdevs++;
 	}
 
-	return num_subdevs;
+	if (num_subdevs)
+		return num_subdevs;
+
+	return -EINVAL;
 
 err_cleanup:
 	of_node_put(node);

---
base-commit: 7c2878be573282a9961c359b806ccf70afe1a6b6
change-id: 20230614-topic-camss_grpah-39f9a4f7420c

Best regards,
-- 
Konrad Dybcio <konrad.dybcio@...aro.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ