From patchwork Wed Jun 14 13:22:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 107994 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:640b:b0:12b:d5da:ddc2 with SMTP id f11csp1350679rwh; Wed, 14 Jun 2023 07:48:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4xZ9cpDsYvp7KRNJY4TL+J1S/08v28+gwRao4HUwER6RW3Y0ZBknjD3GzbYucrAqE9+rfs X-Received: by 2002:a17:907:9615:b0:968:892b:1902 with SMTP id gb21-20020a170907961500b00968892b1902mr2066811ejc.6.1686754130472; Wed, 14 Jun 2023 07:48:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686754130; cv=none; d=google.com; s=arc-20160816; b=VnGWMVpAgb6xRweAG4XbXfjWKUQnxMgFnB3S2dFzhtkZkxw7Qzwsw3+sQH5sZ6r6oz Kv4CAK2VGQWFSIMrYdOzWCUXNIU72W0XOQynodBgY+BQDdf1cjxOkHXs+U2l3F7QvbkQ m/8vf8wRtUl8Y08zcdYsZ/YCcSb9JfNB23tgPtaHgqtdaG4j56/iT41EDppGpw9nBCc9 6ItPGpUk5FLmszOaHU3Ajhyqb7BgzfgyqXbgvVTQ8mKbPltet7jknGvu6fdmkqK418Jr QLozBbnEs11HUkJ7pjdSUvyOupXENNaCqmux1bDSmaC2xWOJdX2r30nFoCGfA+2xk1mx ztEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=QlYwaO+z+1HnbdYgK2cE/Bmko+PlgVBi2h8p1xbV4dk=; b=i820CU/ZBFhZD9iVVshuA5t+Axh38DjZ62sFcOSZaODDEM2V8X5AD6SOAq/x8ORBB7 E48FopNORRBcJB+KTo44TWmV695k6WeLFrYH3Km1OwjQ9PaL6uCXI38eNUnnr4XvTO+L vKQ03rVwqU+Mvy2d9XvNuhaHC61Gwe2WgJBvGD/OWMPpAUrmpAC+3rPHX63I8/0zjyyj iP+LvGhmFJpHtk3POUNA2cAYt91tBR3T59InTyezJg41ip7tN1wL/Svgi49w2DVSpmVX 0a9sbkXgU9rz/lIyhZJrZZFNWu6dk4xyfWuiIjw5nVtcmFdrsBB6U1s4RyOkXZt1r6F2 2XIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A0kek7FK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s13-20020aa7c54d000000b005149904c8f3si5160555edr.411.2023.06.14.07.47.59; Wed, 14 Jun 2023 07:48:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A0kek7FK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244963AbjFNNWl (ORCPT + 99 others); Wed, 14 Jun 2023 09:22:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244945AbjFNNWg (ORCPT ); Wed, 14 Jun 2023 09:22:36 -0400 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C4BA1FC4 for ; Wed, 14 Jun 2023 06:22:34 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2b227fdda27so7994821fa.1 for ; Wed, 14 Jun 2023 06:22:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686748952; x=1689340952; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=QlYwaO+z+1HnbdYgK2cE/Bmko+PlgVBi2h8p1xbV4dk=; b=A0kek7FKuJeZYXzX3n1cYwa0lvyoHTGrU2sLoPUBvMFQhUKHl+ImVQEENn1mCQVN3o IHkOt9XCt+o3hxOogi/E52jhmHh/Yc555zAnTu9p80pPPI8ggKKvNcsvi6YAEbcF8ANp spo32vjJ2soK5HBQlDGF2E9vA3aXyfqaust6T8dbViXEPMdbTrz6EDEkdQ4rtxgjT0HU dFJR7RaYI3B9CYDAbvRNad4ej3vmg14uYRiHHCe9tv2BiF/rrUOva1Xmjxuc+y56orj+ Ehe6WLpNZkWxA1x0mYKGGu1E8iWty9xvP+Dvsnl7i8EBk5VGhY/MPanqBYTCMdO33l2a yKfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686748952; x=1689340952; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=QlYwaO+z+1HnbdYgK2cE/Bmko+PlgVBi2h8p1xbV4dk=; b=jgdt20Az2Hk6vzsDSgR72nIXClfMu69vbRojOMpm+eWqC8CZU5vRNHbjWUK7TSK1/E k2JDOuc38qNpPdGlWVCg1TJN4QxxPBevN7TqK+nuQmMuf+zZtR+khgr+Ee+9CXU45pqU d9ofK/bt7x2taZik6UEvtg2VoRh5j44NbCQmU63gtb+L4heheCMpDfm0zbiksuabE8L5 5u3jmjzGb2SWv5ZHmMe9CqEze/oQL05XeU73ATi0R7fcNKLl0ZerFW5UwQNje/ei30dI kgW5czqd/2eG/YEKj32JylCWcubo44wfTyM/dcD5Ra7cmy1uCuq11noJJbGSKjnvKEsq If0Q== X-Gm-Message-State: AC+VfDxFaw7R7HKzn/FMEzYeMeMke/PqVdlcuypoFsG+pBLFlleEwNZ8 F+rfhogwcjvRZEL8ppqjyHGRjHog7jkB/LMiB3Y= X-Received: by 2002:a2e:86cf:0:b0:2a7:7493:9966 with SMTP id n15-20020a2e86cf000000b002a774939966mr638716ljj.24.1686748952498; Wed, 14 Jun 2023 06:22:32 -0700 (PDT) Received: from [192.168.1.101] (abyj190.neoplus.adsl.tpnet.pl. [83.9.29.190]) by smtp.gmail.com with ESMTPSA id v2-20020a2ea442000000b002a7899eaf9csm2514681ljn.63.2023.06.14.06.22.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 06:22:32 -0700 (PDT) From: Konrad Dybcio Date: Wed, 14 Jun 2023 15:22:25 +0200 Subject: [PATCH RFC] media: camss: Intepret OF graph connections more sensibly MIME-Version: 1.0 Message-Id: <20230614-topic-camss_grpah-v1-1-5f4b516310fa@linaro.org> X-B4-Tracking: v=1; b=H4sIABC/iWQC/x2N0QrCMAwAf2Xk2UDXFWX+iohkNV0DsyvNFGHs3 w0+3sFxOyg3YYVrt0Pjj6isxaA/dRAzlZlRnsbgnR/cuQ+4rVUiRnqpPuZWKeMwppFCugTvIlg 3kTJOjUrMVpb3spisjZN8/6Pb/Th+7YxuJHgAAAA= To: Robert Foss , Todor Tomov , Bryan O'Donoghue , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab Cc: Marijn Suijten , Yassine Oudjana , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1686748951; l=1403; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=EDgfg+lUIqJj9gfFzfZTgsOWNdY99vPNSeSuLOAWWhc=; b=jkyOPuk8pdImD3MqXjm+SeuRsFXWWS724YWTgW7ygW9Qalf83r4qw133m+EbUOffvRW7YJkby 7frUBnscmaxBx4+5REjaLG3URb8zBQQsoe6OZzzEQnxDwlxWuEsLhfH X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768689274789095194?= X-GMAIL-MSGID: =?utf-8?q?1768689899307488133?= 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 --- drivers/media/platform/qcom/camss/camss.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) --- base-commit: b16049b21162bb649cdd8519642a35972b7910fe change-id: 20230614-topic-camss_grpah-39f9a4f7420c Best regards, diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c index 1ef26aea3eae..3aa03fbc94e2 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,7 @@ static int camss_of_parse_ports(struct camss *camss) num_subdevs++; } - return num_subdevs; + return num_subdevs ? num_subdevs : -EINVAL; err_cleanup: of_node_put(node);