From patchwork Wed Aug 28 05:12:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13780549 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 CF2ACC5472D for ; Wed, 28 Aug 2024 05:12:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4D2C310E4A2; Wed, 28 Aug 2024 05:12:14 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=renesas.com header.i=@renesas.com header.b="Idk7Z/nK"; dkim-atps=neutral Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011056.outbound.protection.outlook.com [52.101.125.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id AEDAA10E4A2 for ; Wed, 28 Aug 2024 05:12:12 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=otNjU0w5LT8tLNqd5AS74MJMlVyAXrqYKlitXDq5bAZbkF59ST67HFwrHkOiVBOXDoyMw2cjj5RBtg8yx8ANLfze8Ws3RTCqW/QmPgOPyHZ2IxM82ky/J7z1fIDAJfk/YyY/QXq2ELwcelN6bORmId1JxK9SVAWFypLzF7BRZO2iQ2MwBNyOAuhwUmuqfJMuLePpYMQPg+nVuVd785MAjs7brWPBWfJv4vvRf92E4vIrD3jnKHBnE/JM1qQgpFQiUT2EHg/dw40mJ34hMiP3NfyRVQuUuuTn6blH8hj0hYmP19awEjfmflfZ6u2+F1euG5GlbOXvIQG03VLprfMcYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=kkJ0ltVTSz196uhSee9Ig9BdLX9O4PwwW/k2og7b4lU=; b=j6Akg7tvSAYNshTF6VJAABcDrovwO++eHtz/BTJZHBp/oR4qwgENotQoz87O4VIcIPGfFO8eqaiDx1duniIDQ6SS3znB01Lvx3kr8XAKJ1itfg1vq/tAU+wbNsEMZEtSKapunJRXDRnd6rsZ7PXBi2+c65CS2o93Ymazt31oc8c5udMmd6g/iVI8U571MLc3YpgQwytfllDkIoo/Hszp7FIKS7AzY0hISG/8gUU2zFupXrgw59rSwT/hdQdEPLlQ+gShR43f37gb7vGS1h6baLzJn4J0yy7trcrz8M5XOUrZ1OgSKP8LbMwBdi5q2ybnWgF3EKQmtTKXbTSfM6mJfg== 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=kkJ0ltVTSz196uhSee9Ig9BdLX9O4PwwW/k2og7b4lU=; b=Idk7Z/nKD36/s93jIdS2Pk8cY4LzadawbIhwgkDv798YotxXhvUAKG2TBnK0AJGwKyQsCtA6KSJuXrHqfTsXPlRqin/C2esYa8/85LYp+p7Nc05xS75fiOEsPSrREZAe/NY60098zHP4INZl/FiHqwWaZ1IIsAViRYw3jBxCXq4= 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 OS7PR01MB11955.jpnprd01.prod.outlook.com (2603:1096:604:23e::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.26; Wed, 28 Aug 2024 05:12:04 +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.7897.027; Wed, 28 Aug 2024 05:12:04 +0000 Message-ID: <874j752puk.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v4 5/9] ASoC: audio-graph-card: use new of_graph functions User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Daniel Vetter , David Airlie , Helge Deller , Jaroslav Kysela , Laurent Pinchart , Liam Girdwood , Maarten Lankhorst , Mark Brown , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , Rob Herring , Saravana Kannan , Takashi Iwai , Thomas Zimmermann , Tomi Valkeinen , devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org, linux-media@vger.kernel.org, linux-omap@vger.kernel.org, linux-sound@vger.kernel.org, Sakari Ailus In-Reply-To: <87bk1d2pvt.wl-kuninori.morimoto.gx@renesas.com> References: <87bk1d2pvt.wl-kuninori.morimoto.gx@renesas.com> Date: Wed, 28 Aug 2024 05:12:04 +0000 X-ClientProxiedBy: TYWPR01CA0046.jpnprd01.prod.outlook.com (2603:1096:400:17f::10) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OS7PR01MB11955:EE_ X-MS-Office365-Filtering-Correlation-Id: 3a4cfee6-ca7d-4b79-d921-08dcc71ff4af X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|7416014|376014|52116014|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: 9dtUsMeq7gqRCokoS6yimRH8H+0jBpYZpIkazqyCzZjMrW7Zh2lyFFTPFUR1Ih1AV06flYFd2vE0OPBisbPK5wajzHoF0uD+KcqcUVVOC6UhxRxPWKJqlxZh7Oj7ZgQnn7gpVrDmzeccB+M8eGW6Teb4TE2ZK5QMXHrmLmFVg88Mh2SKmhLyuXAyrpuxUk5E8/p4gwAI47x1Fkje6M0lwDeD3bWd5djTQe1XxmAVD1HOTNeQW3yPdAIBkPwwv8/IPm1W4jzM3j8lgj7m5OaLI0BlKHYId0OUVSWuApp0r/pc1h5/NJSHfRgsjEfQUyhEZwbOUKtQKbeJcvAjcmS8wfDa4ItTxyAzDMavCqPLyxuqRqK1LG+vuAHnoAOISycwqKdcIb5aV3tbh6HKeSxHiVRM/tCdpOQBCu007DLDxHXTzBadtM/K6egj443KQ+h03qIX+5b9qyO5xn6l6TsiabXIcb9P0rz8g91UDDZ8uaYmNc6/5aohxVX2aRaUYpl8Q7sMXgtiATvxDZ6fxA8JLawEkfDT1c16cKsmL30WABpjpTbAUKmpFczup4bZs4uNbxs9wkTfXQp6Ql16gFl/KkpLX5vqDYdbk7YG9DOXLZpmhmY74r9EasHlLz70aOLf8LqWEWS7ueqE0FrbnxM8aglMPQ+33Vx1x96saTEdx20fkOOOc/75w3P3Rkdnf18++urLKpcEkN28jI4gAXEDzRCFEd372t3UwngpRLfWBrzwv+p7perMw3/XOAt8SUwpRBwSjGKT5lvesbnfXOgT+UU2QNUmluTGL/vUUlVmqSehBxuoKpy2qHg/YEr26sDPUN81ZEiXZS7yV1QZUSd0Lv0KSBVc9cxYYFvbpSqSq99gIXSRUpveODod7Z0yGr+PQVVsYuc9ZftZ19ZmgqgqwW56y6W4nMSbIUYLX3wygiQjeDl/RZMAA2GHQFVn0MAilrzsza1EKIcWzdW3klhLtFjOGokrKyntjb1IRQXhmQg3CsnFV2eulj65mBIGXNGGuISoNb415FRFy4L2/XTsVsbAeOwh/LnP2wVMIT+4H1QxU9uIdZcyFFq5Yh0TBbsfZm90UQRciNTIv1pZ1i5jDzNEkt0x24dEcuCXdya12ZHUq779PqAojbrPPG50BAK7IHWeKe3t6jwQwwcuC0xaxF+S+nZZLcpiuqtX5GhEgzSFuEpNRljFhKJxrWogZ2WWeBmRal+xtQOya3IH0JfRHS478EX+H4IsN3+eFQ0Pun9T2aLgeExl+dC25UpBimioIx2YfesNAgNqboIzreY4gDT+dVsj2+Tznu03X06DoLbTTmv66HF/58gtHLDB42h4HYfJoekOSji8Dg1IfMGA3neV69Qn6PW4J0ozd9wy/MGi90w/9iXEGAk4+20mxtMEofgFp0OwTtoVN4gF5+u7LjPdHsbIBwXS7Q4BMHhE72o= 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)(1800799024)(7416014)(376014)(52116014)(366016)(921020)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3VK+WfYoJ4ChqaOtFnkmZ6wHSGL6epTCFGXEpkMcuOchCeJbG99ApETWQG5pmySvY6B1pMbjjRNj8rShoPsg5BjVTwTLTw0An14zg9/g5EDpoe+k7NfY4KDy+H4biHVv7yrIqihpjb+MuqE7tlYc0TiXCImkhMv9HLPsQv19gGbzBK7fAz1eaJc2yuEhR/l5Hv9L2k/+XiF4HgdPHMIzr1fmUSKK46hpakbkmW/00rVjimthzF21BpJ9PyvETLt0S5u47xJIxmSbtSMbIPC0a0przigFEImgU7kDwya47nY2udXBiuOrdTKw5w+siZdNCSUtBGTELlf5hbfTYw5aYrJ4pbhHfU8YsXm/HnP5HvIHBt3t7ijZk2ZH4iVHA+RNyijEgV+W7TtqlRS/4KiDBWOpi3UktPOb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B2hDLpwviINi8saoofJ4XR/B9fdZVAiviTku68/E9Wy3xkXAjREiZs3YmSa9mg2DjIzzX7EarB9awyo05QEQB16f/GsltYOiwvSZfh/xaDCTX6poYS13B9RJ1LKkoZxRT/cxVy7kziHzpRRSEAd3hKJhiFr3AJWdL0= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3a4cfee6-ca7d-4b79-d921-08dcc71ff4af X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2024 05:12:04.3494 (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: Vdc0pQxlxt+kde1qMEzA4g5rdatEzkFwPwKYHliBV8QVkVUJHp71PoO73IJRosLs1ORKL1grAa0bY4Q7n2+zwTZ2Dj3fMMED4iDKK1MvAisSXtRYgijQug/czIDzb28k X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS7PR01MB11955 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Now we can use new port related functions for port parsing. Use it. Signed-off-by: Kuninori Morimoto Acked-by: Mark Brown --- sound/soc/generic/audio-graph-card.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index 1bdcfc4d4222e..e7fd3d70ce091 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -361,7 +361,6 @@ static int __graph_for_each_link(struct simple_util_priv *priv, struct device *dev = simple_priv_to_dev(priv); struct device_node *node = dev->of_node; struct device_node *cpu_port; - struct device_node *cpu_ep; struct device_node *codec_ep; struct device_node *codec_port; struct device_node *codec_port_old = NULL; @@ -371,13 +370,9 @@ static int __graph_for_each_link(struct simple_util_priv *priv, /* loop for all listed CPU port */ of_for_each_phandle(&it, rc, node, "dais", NULL, 0) { cpu_port = it.node; - cpu_ep = NULL; /* loop for all CPU endpoint */ - while (1) { - cpu_ep = of_get_next_child(cpu_port, cpu_ep); - if (!cpu_ep) - break; + for_each_of_graph_port_endpoint(cpu_port, cpu_ep) { /* get codec */ codec_ep = of_graph_get_remote_endpoint(cpu_ep); @@ -408,10 +403,8 @@ static int __graph_for_each_link(struct simple_util_priv *priv, of_node_put(codec_ep); of_node_put(codec_port); - if (ret < 0) { - of_node_put(cpu_ep); + if (ret < 0) return ret; - } codec_port_old = codec_port; }