From patchwork Tue May 28 23:55:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13677599 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 9168AC27C43 for ; Tue, 28 May 2024 23:56:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Date:References: In-Reply-To:To:Subject:From:Message-ID:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=hADwjE2sywQeF72185GQLfIRYdQQ2EzJ/9jp886BP0w=; b=3BQV9Z1kLso+OsX7DVw89ah3Wr CnpwVpJqkhJaP3bd1b/LBcX6JXk+1yK0Fo4ufzav7DBsl7cFkqLq1WS5Fq0AUXdouTVES82b5AUP9 kZP3orqPwCdtlCCL71CC3LtPZmT1C3ha2LXa/sMlrGoQmCXG4mTp9m9vwi16kV9R/GYQu1PCu4a3y NZO1/eGtcbOgqPOzvfv6SHcbRf0ZaoxRBCXTSa4lycz/ZjlKk8mX8keINvtHNU0Y8Yob8PzMBCH4f 6T/r81qgnTOH/Am+Fp6/pj5Aw75XXqsjklSstiH63Co/Zrt4t+AsT9/prN80CYxTV50REZtP9lEbx ODRDmFmw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sC6fo-00000002Md8-0kSp; Tue, 28 May 2024 23:56:08 +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 1sC6fW-00000002MKy-4A7T for linux-arm-kernel@lists.infradead.org; Tue, 28 May 2024 23:55:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NRpnrPu4inCjci6T2Ogp3EwK66w1xlb7LA3ABT+5v4VfUQGYEAvPWANMISvHLafHupBBWE4pVkP4/OM9PyF91KiB6lGSWy0VdgqEWA3bHGCX0tTTZM3N4IaWfmQG1YkDJDyszR69rODybZn2xjXnsPNlxuQSgoWaKf7WPId9r2N3yrgnxiEWiz/CX9agZKJjhECiqbccXGd+Na0z9zJFf4EKRlzh+I2w2UxzXBG/hqsbUtpIw/2arF5bbjon9Br4dv7MU50llV0hAdbVOX9KOl/YIlIKlh//kf/t/flqxZN0xRsLonU04D30+yXIkJSgAylpB0sTEmistRaD4VWtOw== 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=aKyIcOtJvLvD7O2LiyJI/N2rAEc2ca7YgJ2t0jkn4VY=; b=eqWxQ3qZdSSTiHRdjZcToiBRC7L7ZhX28BISOMzcr1A+X+gTxSL3F2Uf/hcfkMHFvXmlIam/pU3xhTRq4Can4bEDnU9CStEYSlerssiDd3dWOkcPAnEheyMFvP3hmlx544c+E2OHia9wWJ1ZO8qhO8eLKVqo7L7A9dKbsV9+6WP9eQUQNn+yzvFx0tgRkOW1aBmRZQPBJOcyc14KAkAA+HpK3r+pNbQYkdc1bkoBwIavKDl3AoX9UW6oSLjn+FYPTB9Cj4hkpS50mxGlwSzMVAJb3XPVuHQdaTo4olm8hFJCTAw3AEj4CphY6ypwTDrHSo6faTACZIqsJCAiRezFuw== 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=aKyIcOtJvLvD7O2LiyJI/N2rAEc2ca7YgJ2t0jkn4VY=; b=FOyPAPAh9w5iXQZlm4bbePLonUTP5yMiqUQod4e4S613YT9kjpdPFuIJdCXf9dUbbiO9eT0j4NQ77P+HsVosiCcSZNpGgrZOLi6tcSncTN3HqHXTWhamLuenl6iEseD0zKGyrpByYhVVTCtvi/lXax2pRXUMTI9w8nLY3H/eMrY= 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 TYCPR01MB11224.jpnprd01.prod.outlook.com (2603:1096:400:3bf::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.17; Tue, 28 May 2024 23:55:42 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%4]) with mapi id 15.20.7611.030; Tue, 28 May 2024 23:55:42 +0000 Message-ID: <87cyp54hky.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2 resend 4/8] media: platform: ti: use for_each_endpoint_of_node() User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: , Krzysztof Kozlowski , 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, linux-staging@lists.linux.dev In-Reply-To: <87ikyx4hm1.wl-kuninori.morimoto.gx@renesas.com> References: <87ikyx4hm1.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 28 May 2024 23:55:42 +0000 X-ClientProxiedBy: TYCP286CA0361.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:79::17) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB11224:EE_ X-MS-Office365-Filtering-Correlation-Id: bcd31a92-56f4-456d-47d9-08dc7f71af0b 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:13230031|52116005|1800799015|7416005|376005|366007|38350700005|921011; X-Microsoft-Antispam-Message-Info: arCV/Sfamf0olJt7SjwaysRzKtPvX8vRoXP+uViIA4Yw78kCutq/BJ16NSXIz2XSpPeDsp8ZNiakqtpHelBcuvS8U8cWVVmmUHNx0tixDdBUNnndt13eJ/ZrjyET/zIcg6OFLJr1jHxEmw/ltB9R6ilAZoMhrY2azXzVYzsMStvDyTxSQb27Q7aa9m6OT8oEJGAXfqvqWPrcIzJfDzYEG3RPFtAPmnt8gc9z98u324irICYAaHvU5LbrW/JdrlqU4PRIv43Fg3f8oGnAClOeM3Zw1t6BijwQhjroXGdk6b7fgM3NK93zPSpZTf6ByFaA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-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)(52116005)(1800799015)(7416005)(376005)(366007)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: dnMdrcfIiPiBGzwcZOAPOw/27ZFggXPa8Fi3TZyNHUwXUUdeUENvYc7GTpWg39FWmaRC1Kv/lWgQpiL0YI2Gi3ABCv11qMjNayb9U7xJs8JEKhk0JhKdqjCcPuYOTVEH3eyvbsc6YVvndwdlfXyTXYoQVZ/WzKVZPHlpHVqQETPmZMpj3uz4yMzggy1x6xb93QBAW5TyVSjJDuJsFU99ut92ANI1RIoXvpboSjpKd2H/6I1BUYAECg76Z1kx/tlaJ0dHJR2uH9Ypb/otuwFnUlHYZHXFk05nymsM1vLk6eA8QcjrrA1bwImwndwz3uSWNKzbZpHTwGZ/StnrHK/EN/qe8/C4OjMCNdftPmuAoLTg8qTh8ME3CqZPMF17fDIw5zebmF08UeNOTEIhwgJENALsHuyt48vLFe8YLoyVm0LTizT/zSYUIrf8zv3g9JRsmD49pwqc0A752ow3BT3XKE6zEOkWi3nvNdmr71sCFeIR+UPij+DvLvoSnwTm5FUOTEO91eU7afCXYIIIKd0KZIT+0HRIcfrn2GAJTmrg4MEvUKIKX0yr1bwUEDaN+me+qrRVdfwliVvADTPixQF9MwUxbc0LbSJtGaSiLnWBawLanPFjG4l4yEyaAOt1MeiBO92/cc12x+5E5lJ/kowGnxpjZdJJVcAdsMATd5mNqTvION0+yszwIFqbcGLpXUg6DjjoGjVnV2nubc+5YJ2iJCYEq8FE34QZKozh5Th1nuOOjQ04uZ9BzBayDabcYmmcyvPtDZTnXql0q7w0xWPHUWW51rPRZtcPCih7bjmvF/mb191rJBCfvpakw+awa9RLHVKhAVGaL3JOCdRjBJKkdbDAB5iXs2PjCyw/xHmUMOhMOVSMUF8xG0hRXAJsowprHt9/BOqa3Gav4n/33rnEoE3wbrOW1vPfBWHqBmYLVTSynhYy6vHzaIG524E6i355GJmhXooKDM0QRMFhAXQDM3f92etmL5skb3JJWB5DCScXJRxF03o08fJQ4gJUTOINYG2ildzm6ha5Gz4AE91Cm4TGl6O6S8GADTim+MnK+3F3vvBj+puSJ2vaxkfRVo9LkN0d0T3ZhGZo+v8Iw8rrzzXTcT7uQUgOvBpeBroU5OmISD6U3WULuR0KsPKmATrzYLXYBfLuSAMljZ2ufhHPcM3YrUDPSiSUW+n6mQocUyT7A0ZzbmupJkVVuMoDZUfePkZxZn1ORpNEeFCfPwgD5n1WmxfQhe55BMQ+ip7OSFqqQG507qYZgFYRkTG84MGnmCZKtD+3S6V+mAisLEB4u0AQFXJ2a4/zPSkwkBjRB4N0Ml81OK/jVFxH1PBnBADfclcQgK7UCEB51odHbCy+hdqw1ickCzdEdYOckPvJ+sjKHMw5YR5T5REDVwNsS+eHbkLaedLbAW2NrtHxjVB4VjE/mrDf9l4XV32geskXCQJ5BzjBwjQxFlKrsM6tmwjlCfvJJ2PS38IPCDXuwFUp0AH/BW0YpM33GrmFG06Ej0+XsQXw80BfAu/a2IuPxOcFC4GRj9GY2CPIgd3wR75mosb4A4jBYd1MjszvRtK9/6wC2I0eOL85j4CVIS3X+Evs6WdhklbPYejbcz7rtsEYD1KoNU4yzQ2yMdY5n/saS9g= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: bcd31a92-56f4-456d-47d9-08dc7f71af0b X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 23:55:42.5664 (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: +Z0CyN1IR5Xf0P1Glpea6BeJcvBQNOtzwMrnZ4ymb1AQWybI3qjsFIIrGuAsb7wvYaDWWBefb2bspWCetm/26va+yQ+TBxcEZNE6yrEqEm9YwbhDMSEWZmWjfNAFioAc X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB11224 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240528_165551_172961_EE36ECA3 X-CRM114-Status: GOOD ( 16.02 ) 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 --- 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 77e12457d1495..009ff68a2b43c 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 c28794b6677b7..078ae11cd0787 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: