From patchwork Mon Jul 1 02:32:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13717507 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2394FC27C4F for ; Mon, 1 Jul 2024 02:33:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Date: Content-Type:References:In-Reply-To:To:Subject:From:Message-ID:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9j3NpXbcZa2ngsRcLst0L0Ff9XISFwF0hb2TrGyyJro=; b=AE9S+hqu3IoKnJ4DZ3IoZcwarw lDhjqcllKMLd4DBHn6P0WplWt235cK55YVNamYhJpXP+u7MnE9dIiUrjBpHwxf/4PiRHxkBS7aKf4 dlBq3on88U+DS8zXbuiHqcmWux/ivX+lCaqucBHjaYLmZfoUYIzY/9VKaJTfhVvSZWrK/phDmAEv4 P25d+H13HyEtM22Tmnem0OagMyDVxZE5MGlkxn5iHDi/6QIyMRC01NC9zYAWDPEOd7LuLERoKAauL J9YsPMY59PcJ99RFGxsck2PdIcvc97qxcXDvmnP5z599cDeyT5kLH7xlbO3KVR/YSpZrUDkUBJEdm RucUH6rQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sO6rJ-00000001U1K-3xAr; Mon, 01 Jul 2024 02:33:38 +0000 Received: from mail-tycjpn01on20601.outbound.protection.outlook.com ([2a01:111:f403:2019::601] helo=JPN01-TYC-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sO6qc-00000001Tm5-0kHu; Mon, 01 Jul 2024 02:32:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cwmOQso3Mkccxy6/X7ycww7qir6d4yS/KFhtinnimbiyoUCYV/wwfmlhWMO9vx4xR3tADg5ba+6SJNWnjCqM4stie6zycifTC+p+LERxVxnJoYmBS7/sYv9Tc6yMWVjVF2xeEGcYRZEQmuPUXAuMVSjZM7K84t6OSP8AL0d4d0J8y+13sslkvcUhGkS2lnKCbO/r9p2A8YCYfN671Nv+YIfd0gPYoUPS1VOEU4BjWxDg1ZiDC3tEzjH5EdGHy/Jiirgj+1wFMEm68u1byF5d49IptvHI+mMLYGP+ELy4OxbTVUkQMy4Md1EXtOemg4x5NF0f/6ZFg7+NifEKEBNaNg== 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=9j3NpXbcZa2ngsRcLst0L0Ff9XISFwF0hb2TrGyyJro=; b=apPl4xpJsJntNvC/O5yLr4HEoFMbJ/XV9dkMUZzx8HpZZjYtQmF6JDPE4+RD8ClWHwuF7++Wf36ExYM8BkmeIe33utqdGAJUCBfGaCX2vfc9bLRNetNEHmclHTwf2/fBVVftV4ZuwvQUr65aUHcTaZeXapjSh6LNWpEuFd5dFVbUidXqAiR/1gBLJiG8k4vhn+IYVQVAb/Ivkc/y0i4vN3mTEsDaMcSCDamIhwx3H33FFjK3NqRflrRnk47LMBqPhUeOm1QsCF8UAWZuaHkdqaWD1oBh8fB85H0iA7bhNsjwoBCMXNlkePXh0DsyPSFuLU2moD48uBgJSRoTcavHXw== 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=9j3NpXbcZa2ngsRcLst0L0Ff9XISFwF0hb2TrGyyJro=; b=htcsHxVWO/fIFaMjaDP01H6NE2zZUlg3AzDsK5PrI6zQIyKL28SfJrBW1BPlCf2eKOZMiAJMqK28iH42veJvkraBTCpzRVkH9mQ/0/DfI5in2gqzvhdZLQlT/+uNjA+X8nvJgXGHFPCQ+P0Wvrfz6Ys71oiW0x/VEseW0Ck/nZc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TY3PR01MB9730.jpnprd01.prod.outlook.com (2603:1096:400:22e::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.29; Mon, 1 Jul 2024 02:32:50 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%5]) with mapi id 15.20.7719.029; Mon, 1 Jul 2024 02:32:50 +0000 Message-ID: <875xtp96zy.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v5 5/7] media: platform: ti: use for_each_endpoint_of_node() To: "Lad, Prabhakar" , Alexander Shishkin , Alexandre Belloni , Alexey Brodkin , Claudiu Beznea , Daniel Vetter , David Airlie , Dmitry Baryshkov , Eugen Hristev , Florian Fainelli , Greg Kroah-Hartman , Laurent Pinchart , Maarten Lankhorst , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , Neil Armstrong , Nicolas Ferre , Suzuki K Poulose , Thomas Zimmermann , Tomi Valkeinen , coresight@lists.linaro.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-staging@lists.linux.dev In-Reply-To: <87cynx971l.wl-kuninori.morimoto.gx@renesas.com> References: <87cynx971l.wl-kuninori.morimoto.gx@renesas.com> Date: Mon, 1 Jul 2024 02:32:49 +0000 X-ClientProxiedBy: TYCPR01CA0024.jpnprd01.prod.outlook.com (2603:1096:405::36) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TY3PR01MB9730:EE_ X-MS-Office365-Filtering-Correlation-Id: e2188268-3bbd-4408-40fa-08dc997619c4 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;ARA:13230040|376014|52116014|7416014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: givcfFCSGzYzKg0MW8BRR1EdxCLoNLMW9MiDkkrz7FZILZi4X7aOfN9fjZ09StrXSXuujS8clX635MiBUoOjJ03uL3hVUZi5tWs69OtEA5QRcf+LsNhIbYD6fjIHmwTVFXgiO87SLyihTcHobgdsULY1FVfLrqZ8xxvXeEH+p3aBqtwzGgrA9mxHhXaH+lOGOfcwFmNemKaCXhVa3E8iP4tSzBykIJCXf/44TekUj54D2c5hsfZFMVNZYJq7LczmtL7HFJelXAuHV9EBZyU1Cxa2x25Yen58aPnZ3R6G132tNyAo/a3QP4IMKle5WoEoF2txSfEuca5MREYGQ8kacaTxqGs/BzrGPVVz54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/ZZT9wTmpsX05wjy8= 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:(13230040)(376014)(52116014)(7416014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: XB7wU6OmI84dZANLDy/vNgPRdsXm6KMR03zOOEUUUN1T8fCZjnjm+L2MjV+C4twNLRTEggGZpO7dR3jHgrvmny8QkchvNv6W6892uqsWdkW+hzzAz/gq1enJOVBEy5j0CeRekCvqlBUOmygTky/1PUbB0SCV5oWmXGPOsrjCwGgVK2/xOJIft30REDnoIBfZi0XKFMWRAYSXfrgWz0Cs/Oqt57SwXpMzj5Un46EfhIG92l2rs69yC7huR1Z+HjCjq+4xccglNleW/gFO3DPcNlgS/w302NI5wAZS3xxp1AmmDBB6//aOjTBl8JD8gN8DC7hvJBfMZqYm6tHpwvY4b/b4TjSjX4QsMdFTPlcg4BWcdDXwjUUpuvvVX/Hx3aHdxexWpW5qauriV+fNapLY+llGHMpNWRvJ0ZLia1L/qRn1/9W/Euf+UVU8SUpA4eg7loUIGcwJD2Dvj8QxmOcoKqRB0E8oQlGZY+Yjaoj/bQN2+zefkE1Zjoa0sO5DGrgvyFfOTWyyapXbQCJCAkKPl/DVnoV0NMlvpZp8FgHNi7Z1GUp3UGaqUZ2hcg558UJKkOkd+MiqQbVKZPqnr8P6cnTB0tlAES03wQmi9FUMKJlzJTWrN4Mhx2XUZ1VNkOVWXcG1pUDFo3HTHq4U9hcAlIEoavx9blY6tOANTp5ZB2a1iWubBPmY/RUYaSdJ6TSLbUCHbjWzEVEjLkHSuQBVzXB2AbcgCA83vglkatTdyFBGlU101jlo9Bqc9E3IF3Qae2jlLQA2YIKlv/0y6EH965j78M6G8YkWZn2d/hezwf1Nwm5YXv1F+1Pmk6ra4sqoMth3b7TTnFlSCEPb9EPim6dkmUuOX1qCQqXxhmpOz+v1qqjyeeIe1kNkbDyZrRGtMlf4f0ty7vD9aLeuuQXHa7+a/sW5/quo337c9SB2por/LaJo+5yaI9xzSIapyMqKLEhqHKZGJbtWH2Spj6grT67tzIcW71tD6CidfM0QFIYV0O0QRksltNCuhmXiswuZpXR8/h82cgXPZKc6OwqHZfIQbau8Z/JTVffeno6qFQMXvtO9PMEExFSo2G3q8VOOwOWYJFfoJokX76UhLi8ABB5wtQ2YniweEY/LQ2c7GHF35MMiP9oXTWmbMOmYOqY5pQ/MloJUGoy0/wcJHvNDHrU89OtAli1B9wOycW+r3geK9a4bL+NvkzNKSaxIO6PWARB20tgVQFS6L9r5ydr1Smc4tWKB1Jr9ePtG7WDhrzhwIaSjBVutSmZJ/OONOgVJfnH8W+JMsYbDl+VUcgpmVoScRgW5Gyvn4oGDi1vdz08B+OUh3uD1893jYpVXc+8Pbn1HjSZiiamZhZ38sy4aU+anH9aqurvDzX5h6Xy+mTu6HQVmAIwn+biw+x8/ZImqv3g+ncZuvPF6rY0fRiz7DdasZBvjEFrdTri4JIRPzyGjY5i0H1Xn6ETQbLO1aabYcf/FtUCn8VCZiyQWRn3gmRuVCDF0qqm5iJuyj4i5PgOxg//Lrs3n5SgwGp4gXj+qOzd2oNdGEbhYaO5QC8W6ZErwpTUmOUNR1ClSaChRsYPYWIQ4FnFuuweOfTzntIoSXwhTg59ka5TBhdaSsWa1jlsSFHj6Injj04BdG+OPQdg= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: e2188268-3bbd-4408-40fa-08dc997619c4 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2024 02:32:49.8572 (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: BnZDQ2/0DTfhbHYJWWVvtVQY7dAM+uEzgX+CGeDFUyjVD5a0YarB+0/PnF7Fv+ukge9gb0Bd9syrBUVzUHqnHGjFqap4GhV1pDcMEDT80hqwshh5SiqDXI22dWMv9Jcv X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY3PR01MB9730 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240630_193254_249130_B4AB5DC4 X-CRM114-Status: GOOD ( 14.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org We already have for_each_endpoint_of_node(), don't use of_graph_get_next_endpoint() directly. Replace it. Signed-off-by: Kuninori Morimoto Reviewed-by: Laurent Pinchart Reviewed-by: Prabhakar --- drivers/media/platform/ti/am437x/am437x-vpfe.c | 12 +++++------- drivers/media/platform/ti/davinci/vpif_capture.c | 14 +++++++------- 2 files changed, 12 insertions(+), 14 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 c28794b6677b..16326437767f 100644 --- a/drivers/media/platform/ti/davinci/vpif_capture.c +++ b/drivers/media/platform/ti/davinci/vpif_capture.c @@ -1487,7 +1487,7 @@ static struct vpif_capture_config * vpif_capture_get_pdata(struct platform_device *pdev, struct v4l2_device *v4l2_dev) { - struct device_node *endpoint = NULL; + struct device_node *endpoint; struct device_node *rem = NULL; struct vpif_capture_config *pdata; struct vpif_subdev_info *sdinfo; @@ -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: