From patchwork Mon Apr 1 00:05:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13612328 Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01on2138.outbound.protection.outlook.com [40.107.114.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 28B737F; Mon, 1 Apr 2024 00:06:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.114.138 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711929966; cv=fail; b=tkV1Dd3+/PP3PiwoqJ22CbGHNE7Tq650s7Zy+jJ+TvHNrMZLZ6BDHeO20XgBeb0nudobw1JjdLB2dc+d2NTKlFwmENAZqZKTW6hfaDHYiEaJDXLapKFyhMjwYs4FnJPr+J6+K8yzTWfvuBI9u+cNpuLvZmItG2nkZYVUzuiVUZQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711929966; c=relaxed/simple; bh=y/VWUaRhrWh5SN3qAPvc6x2ypUvZHiJ5XUmvJNocumw=; h=Message-ID:To:In-Reply-To:References:From:Subject:Content-Type: Date:MIME-Version; b=E6FHZP1VTgTFLYHG7IFh8Tbygz/+4m+mnyONxXpghKFKnDHTFm0fVMJjLcvltt5/UGeDrH0LMVXfigjgrtW4uZKj0OMBuQBEohxKw415xZrlmQdz5VkNGuV7NQDquapE0sUmOlTnO8xvJgJOhXrBRa+mIoAttd48ux+XRpy8Rss= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=NoG7hfbP; arc=fail smtp.client-ip=40.107.114.138 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="NoG7hfbP" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UlaXhIfgQ6YE8KeKjfskFVDS2kdOuDu8ppQEsnvXM44lRkPS9VoH/c0ZGouIIhNe/UEvhnr55CaW/Oquqb5+iwcgXvkc3nJ92fIk0xJgzT0WPLVZI4K9h1ImMZWaTywlCCgog6WtstYAKeh8f4rITHVq+4ehR7TER/bckyxAWx2/vHWLQUrCW1DpLefIcmKzA61xT/35fQJEkt5dTuf7E7E94MPLRuHoVFh8KQ6738bVcyqaNYbGr6tMNfwepp4aPlpMCtuBb6DbUUmSODd0sWDHwYavD3L64Pt7/JU7iSdc4PxHacUzRnGMxGJcO6nSpaHnLm8uPdRErxR2q7tCJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tWWHXH+ps4LD329Qze0LPOm8bcp19Ue9qMXFmDFvMqQ=; b=h+IBVDhwImVzuEefPkNHnAkDhp9GCMX6/ImYHQVdp2H+niRDVVVd8QgMLJPfU2t0cIFi3S7dSDYR+Ls2VUT5BPvPreX18z5Zc5WquspKP9d1TaxzSbBVYLIoCKoJ2tDkZQQJJXomhcHFWK+H9/5boQMHtvlAksoVmnWrDVWnZsBYnMQyGk6XI1ZBlOK+ium+7/E3l1BOQDBt8a9WDWbs20g7fsC42wCPjA0lC9pgoWb+4cuGgDD432KyreZNic7DrxKa7S2hrb9GGnoaAAanfvh3G0vcJwhABnZrTC0LKwWilqfvkQ9BvPMkLkZ46t72kGEOAXJ0wOjXK8LAuQe8gA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tWWHXH+ps4LD329Qze0LPOm8bcp19Ue9qMXFmDFvMqQ=; b=NoG7hfbPmkEjtdKrFrDnSsRMVESyjIgPo150BSJLwYO/+E2khxdnDqWsIaFGRz4qouzMRQUbv6no5+5Q7uM6YvJPvucRMsl2jnc/tIPYK39LJc33rgYUxOxbrtsL3eiiN7cpcNuXlEuE2PvTc02hbz4fzx2efjyeMXk58lYHo+E= Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TYWPR01MB9325.jpnprd01.prod.outlook.com (2603:1096:400:1a2::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Mon, 1 Apr 2024 00:05:59 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::131e:55c0:a4a0:713b]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::131e:55c0:a4a0:713b%7]) with mapi id 15.20.7386.025; Mon, 1 Apr 2024 00:05:59 +0000 Message-ID: <877chiueu1.wl-kuninori.morimoto.gx@renesas.com> To: "Lad Prabhakar" , Alexander Shishkin , Alexandre Belloni , Claudiu Beznea , Daniel Vetter , David Airlie , Eugen Hristev , Greg Kroah-Hartman , Helge Deller , Laurent Pinchart , Maarten Lankhorst , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , Nicolas Ferre , Rob Herring , Suzuki K Poulose , Thomas Zimmermann , Tomi Valkeinen , coresight@lists.linaro.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org, linux-media@vger.kernel.org In-Reply-To: <87cyrauf0x.wl-kuninori.morimoto.gx@renesas.com> References: <87cyrauf0x.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2 4/8] media: platform: ti: use for_each_endpoint_of_node() Date: Mon, 1 Apr 2024 00:05:58 +0000 X-ClientProxiedBy: TYXPR01CA0066.jpnprd01.prod.outlook.com (2603:1096:403:a::36) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYWPR01MB9325:EE_ X-LD-Processed: 53d82571-da19-47e4-9cb4-625a166a4a2a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ua89y84TUnnhFvyPPAse0al1j0GeqPl4Wau7JCQXK3VGaEd0csgnReyd0hJOGgSp99QBhCGA2ay1G2H2HUnwTLdv7XZKXOvNm6QJvMT+sT/B9V47OBc6W/0RPrsHXAZACGD+1cWARy5Atdc0FyPOud0v61En/r2ytE2XxZoTkqkZWcRShTWvMSd8c4XYB4gbo/Nw26j1UgtM+u2zABTAw4fw87XVpIgU86RYASbHx7oDu/cso/EJMBFP70xpfOuXQFucCu/hu5hXUA1a5Nu48U1TVbINd9sdA4K31Wrq4KBe4StR4ogLPN1Q8xhT+JDYTiQm8H8zSle57cQQzqAhsQR8VhL9v5/NT5WvI6AEz3uzeWui4qkahuuAcC5q55HlUfyed9dQDsG+SLvMYketSFJTxlhIJKtvfpjgrs9MuRP+vKmKLjJrrr6sIg7hOka1MzT11xAAwUP0gd2KZUsuc5n+9rSxispUARqwR26xxLKv1pibRHZRi2xiEBon1rNuEMEKSTBgbcyxCgx/aFAQv0HNU4qze5L+uEWniWoRYSfyRQJnnSBryWjEmQao1vK2tszh77sPO1Ud6OdXjmiEf/tIEmigbJld7rHHHgZRBV0wo/1DQSqbnquoDNc20z96aIjSsMcJOuxVwHyKx0DfBnx7xGmrsYywv1oTsBnEnT4UzL2vxGZaKKKl2HWuILmiya6Sg56hgeCv8w/A1u+3anfta4bSFYEG6d1lovLOLpA= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(1800799015)(52116005)(7416005)(376005)(921011)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Az8uJD9uruA9/v1NM8dnHrjPczmr31tln/ClHXdUTAif17MEHKqsQQM7z7m6hHo2WHq4fr5ZVGREy9e6o0+SHNW5CEKsgUOTwScRJVx8u39MLB2tGuVmDh9Z+KIqcR4z8EpL/urzMY+0RB0igHn+q2LK4nuZpoxW14w6fQlHH/SpGOFlhYQCQXXjgxSS4X1L4mVmkx1hAhmNPWLFMou4X9IonjrCpE4uIq4DvkiyDzLWXAKH1vP7FWI26vWOtSN+jZcrRKwdgUjLKqBJ1qhtYknNSLeXpHn7k/o46zbTUoZItMMSQWjbJG5w+81+UaxJTHV0YCh+HAutrmRuhGm0l/Z7duQRDfGTGk6Xh+W7sL4+VwpC2Qz2MQnYyE2vTU85nF/I1QLAzwFuO7GLVAR5Del5srmHaOcuP6Rio8WkdVG2XWoC5B2PZHDORzckzN9zoIX3sdm0l8fhU8fKSPuHYiIjCHIZEPXsUExzVw27iDYIMqJyjbgCkjNDT2idjIgLp8Rvx/Ml+VQIV/yMpkAzkftdXHTqDc4puQKB//hl+CrPaS1W9wCjvUIDOijjlyar3dvA46rauJ4b/MA11tarX9A4OXrcR7GqbTWenzvrS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4e94-e695-08dc51df82a5 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2024 00:05:59.2597 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Xtu4pNUQeOomlrmqQrjmSzDAZ0RcPMBte31cLGk4RleQGBj5EGBjHMUnyqWe7bnUbCRpsj0w1+EtKaWfEPEH87jUDwXE25qY5s5yp317GG9s1hAXXPenc5KFKHrsCvWm X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB9325 We already have for_each_endpoint_of_node(), don't use of_graph_get_next_endpoint() directly. Replace it. Signed-off-by: Kuninori Morimoto --- drivers/media/platform/ti/am437x/am437x-vpfe.c | 12 +++++------- drivers/media/platform/ti/davinci/vpif_capture.c | 12 ++++++------ 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/drivers/media/platform/ti/am437x/am437x-vpfe.c b/drivers/media/platform/ti/am437x/am437x-vpfe.c index 77e12457d149..009ff68a2b43 100644 --- a/drivers/media/platform/ti/am437x/am437x-vpfe.c +++ b/drivers/media/platform/ti/am437x/am437x-vpfe.c @@ -2287,7 +2287,7 @@ static const struct v4l2_async_notifier_operations vpfe_async_ops = { static struct vpfe_config * vpfe_get_pdata(struct vpfe_device *vpfe) { - struct device_node *endpoint = NULL; + struct device_node *endpoint; struct device *dev = vpfe->pdev; struct vpfe_subdev_info *sdinfo; struct vpfe_config *pdata; @@ -2306,14 +2306,11 @@ vpfe_get_pdata(struct vpfe_device *vpfe) if (!pdata) return NULL; - for (i = 0; ; i++) { + i = 0; + for_each_endpoint_of_node(dev->of_node, endpoint) { struct v4l2_fwnode_endpoint bus_cfg = { .bus_type = 0 }; struct device_node *rem; - endpoint = of_graph_get_next_endpoint(dev->of_node, endpoint); - if (!endpoint) - break; - sdinfo = &pdata->sub_devs[i]; sdinfo->grp_id = 0; @@ -2371,9 +2368,10 @@ vpfe_get_pdata(struct vpfe_device *vpfe) of_node_put(rem); if (IS_ERR(pdata->asd[i])) goto cleanup; + + i++; } - of_node_put(endpoint); return pdata; cleanup: diff --git a/drivers/media/platform/ti/davinci/vpif_capture.c b/drivers/media/platform/ti/davinci/vpif_capture.c index c31a5566fc5a..3db4e82c8a80 100644 --- a/drivers/media/platform/ti/davinci/vpif_capture.c +++ b/drivers/media/platform/ti/davinci/vpif_capture.c @@ -1517,16 +1517,12 @@ vpif_capture_get_pdata(struct platform_device *pdev, if (!pdata->subdev_info) return NULL; - for (i = 0; i < VPIF_CAPTURE_NUM_CHANNELS; i++) { + i = 0; + for_each_endpoint_of_node(pdev->dev.of_node, endpoint) { struct v4l2_fwnode_endpoint bus_cfg = { .bus_type = 0 }; unsigned int flags; int err; - endpoint = of_graph_get_next_endpoint(pdev->dev.of_node, - endpoint); - if (!endpoint) - break; - rem = of_graph_get_remote_port_parent(endpoint); if (!rem) { dev_dbg(&pdev->dev, "Remote device at %pOF not found\n", @@ -1577,6 +1573,10 @@ vpif_capture_get_pdata(struct platform_device *pdev, goto err_cleanup; of_node_put(rem); + + i++; + if (i >= VPIF_CAPTURE_NUM_CHANNELS) + break; } done: