From patchwork Wed Sep 4 06:11:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13789823 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 C8A60CA0ED3 for ; Wed, 4 Sep 2024 06:52:44 +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:Subject:From:References:In-Reply-To:To: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=kkJ0ltVTSz196uhSee9Ig9BdLX9O4PwwW/k2og7b4lU=; b=u2skY68yr0lUsIEyMMqYB02Nat FhYnU6MwgHQ3i2ut7GhOsHXhEWs8qjVn/JR5In0hb/hj4veDtA8b06xNfh+omGc36sgfGL2joDHX4 TzZ1xQi9Rk6R32fyAy2zS2KAWkhSEOFf1F4lYJT0Bqv/xtouOAwAs27YrWn8h/11Qo2TdodLHb3B2 TCxBkIk1BtadOWCx/5a9JgjzvfefZmheptAwBZ2bWaAmxa3Bp5Uy0KhvCJKq4MXtykBx7UXuDnz1b yn6uvSQCGozt15CAB/lT1BX4K8WB50v8ybFq7sI7nObguDSUz9Q8dqXVjmeox1PDJpxl8qfxig7UX CaC7lYSA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sljJa-0000000308N-16b0; Wed, 04 Sep 2024 06:16:26 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sljFW-00000002ziO-2xc6 for linux-arm-kernel@bombadil.infradead.org; Wed, 04 Sep 2024 06:12:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=MIME-Version:Date:Content-Type:Subject :From:References:In-Reply-To:To:Message-ID:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description; bh=kkJ0ltVTSz196uhSee9Ig9BdLX9O4PwwW/k2og7b4lU=; b=jX+sgNHDuY1bYgvpKzf9BF+rr5 JL61KoIePXzzY3qgKwcg6JbZnSk8NhUAq2fZtmsBO/vQ7yB8+H6TxOWZ8nNHB9JJxLm0A6cbSmpe6 eQIGJL48AoaGORyq11xH6cor6c6eevhyO2CkQIGEPNR5ejTmLbSfRF61PtYvi8N426BpGbcLRnkPR JX0fdPRcmt3LmKGseWflJXZaB5uG6FDClrwy6MPCmt+FaQL6wEtlS2rnWfD/gL8nr5BcOl3JDIR8c oDtQy+ad2yQ9ZxUKNC7q+CR3HiLm9cQDrP/Hy39UbTpEtqBwV+Bbw7BulTPMvonoAMyIX15JhBvJI 2BEqVjJw==; Received: from mail-japaneastazlp170110002.outbound.protection.outlook.com ([2a01:111:f403:c405::2] helo=TYVP286CU001.outbound.protection.outlook.com) by desiato.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sljFS-0000000081I-1iub for linux-arm-kernel@lists.infradead.org; Wed, 04 Sep 2024 06:12:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=oqmj5F2F02DH4KB3rYFUgGv4LQiKnB5VNbSSrHLKK6ep8NzEFGhlKX6zcQ36YCDCtBI3ECfNR9vComL4AVrMpILkDQpU9jL03SPRHKNynjjNpv+qVb5v45C5b+qc5ZkDVFKEBWyHeOg0RkxfksPiR7GdmUBeFIXd7kndrimTpGTO46dWnuG26dt6R+uWL0KgwmT+ndFiwd5VHYDef3QOj+ywNx1eIWsNTEtnTJESkqBS2p0lDJMi62NyWWBnoLyD4py1hGyL8/vOGkss3mch3HHeJ5fB3DUneg87G3iQOcGa4h0nFzQ25dZK5Ehaw2RRxdyKhuIOa/tCZ/K667sljQ== 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=qLbho+J/8b5DUWla+TzbNzesOYdFQ7Ksnw71DBDDqUGDkHY3HZJrRpa009CAbmzfMzWrCMajG606Bw36AfqkuBQWASE917/R9gwUirYb8pO9nsKtd2RLYlcAmSdXkhzMub/zqPvUzIjlSZ0ZDT6ilOcqN8Y6VoDl2AlEoF6GTkbJjzsfuE8+WdFleWY6One/IDmd6xYgfl+wE7x7/5NOFhOo2aRzg0tdnZ5Ncih06S32hcW1iG5qb46TjQ5b2cLJMbMIKtjRpXVvyXar4959GJ3bVr6l5nqlNfdhRqOBjHC+WI63NBoV5OBddhC8QpNMmoakw6AcPxP3A2pheVPmgA== 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=UfL1yunIWjvGDBYuz8YJSRcyGd8dBYGUuNoG35qC4xVo12v2OCWPRX4BHdZoX1Dlb1w1IFCpZ9SRxXqAoEoYw3MwtnYcPFBRtlY5B1TcccIHPfJw/WrHPCMe+UJmpcCCxoBc1MmQ5GU/hHhqrtMW48mGgpX2z6YjCM0BNzNDfik= 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 OS3PR01MB7309.jpnprd01.prod.outlook.com (2603:1096:604:11e::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.27; Wed, 4 Sep 2024 06:11:29 +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.7918.024; Wed, 4 Sep 2024 06:11:29 +0000 Message-ID: <87jzfs6j8v.wl-kuninori.morimoto.gx@renesas.com> 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: <87r0a06ja1.wl-kuninori.morimoto.gx@renesas.com> References: <87r0a06ja1.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v5 5/9] ASoC: audio-graph-card: use new of_graph functions User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 Date: Wed, 4 Sep 2024 06:11:28 +0000 X-ClientProxiedBy: TYCP286CA0277.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3c9::7) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OS3PR01MB7309:EE_ X-MS-Office365-Filtering-Correlation-Id: 625349f4-7eb5-40e2-c536-08dccca86a5f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014|52116014|7416014|921020|38350700014; X-Microsoft-Antispam-Message-Info: i1+rq76tDMQT2IbP7XKNuxWAufYjWNQ56RLcz7b+YA9/Two2H05wBEXb0KIS6PXWS0iSJwdcYvA8GG5eVgyAbkki8coZ5HGM1bmwPLcQdYeIgC7PPUrDPqhqmQSXLlgUqs/Ni5wo7CxMOgFBYKNDypnXRfY8MXa2Y+r2tyQwHkFS2gwd00BbDTtHY3u86SFmMCBJe5ko4cGwbjwg7CGBvhBELJi9gBCewjGSmhP+3d8jpY6jRURt1ynpvNLDkC1y0GEOaHp/N5yuAoyyaD1P82oTWASKXanhu3R6DWF6dmhAhqC5DA36rWffeuREk+ZYsfAYBCVCkvw+Jd9pCZaD1jjWbwZH9XYBSxlkjmKsEzwh6XR5T6lTROGiKy426M0hRWHszRO8LySLFXtRfaTq0n0lSElr+gNNktBlWL5mFNLdtQLGe81B+0CwDRgWNCFbrdMskroD6EH7GRjN+beiKPxXOiHMmtKPanlWuR0sb8y+6YZm6x9HB3zHXjE57jP2e1fSqjpHHJhsisRaUW8jakejFTVjPzEnpj0zHW6Qmx5hoE+3c3jM5rFObySg5x8kUyOah7FSDncdWbNQHFnftRhdnao/g7r/Y/rWYZrswLgc28JFOP4cqbH95GOh06Ms6ls4CmDzjAX34JEZV1WRvmDs4tJW3EPpaDKRJAxt6nKLTeAFtEqWvy+AUFSr7KjmaMxxHwJyWkCtYF5xpXiXK0CeAPlQxat0k7Skbu50thgkc3GAej1bc+PNsHF8RWlvCD1LWA4kq9FKAb/DyVJZIZ3EXdgXblE1YfeKBD32EV/+YtdeII8OLUlI6rLiQ7rXa/5lSn1PHiKbVeRVC2l27FkM3dgQ1q/xX3T2XEwkwZbzU5FEnxfW1K4puqH2ywEyA52O6pLBhc10Ub0zKKmzwDjCfeqvgirSEzLrwnIcCIWBjmGMmj7uaANj7jf9ilbtcIDpaDSFxXEy3TIRzRdysh4r3/AiZo4wB2sdSO+kQX6rwZ9BX+55igTJbAjO8BKAl8SrJO3G2n9niQpyz8mfkU8MlPTZcUuP1KZnShYhZaCnazTEjZW++vAYc71IKQQPoMVTb8Mo0xtpzhFpa80+IjczSPypieO2Dgifm5EZiTndsqC2OgGqK8iX7wIsr0nlAt3tfMh4JINvgRfyjspoDE9uXPgYvMMf1LFabFSwVH8umc60KwOUmHlmaGmsxAm9UD+G0Jiyj11dAcxvsqCVGKDj+IufCryvStduU6MpNZr9Qh6NHkehBLC7w+j3HFERooId3zL0KcfEbsMa8btQ/GRfTz6kJHkvnySH4bEFj7s7jAFgFpowQ70EocmjNnyO6cA3zcL4qV0wvPeVA9Zhv5+4um0OHn3oIeSxfJue+uiO16ZLtOXe7Po0LD7kCPuZLYVLtmY2AI8QVsezQ6GyDokXcE8qEd9pyems7SpnY4c= 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)(366016)(1800799024)(376014)(52116014)(7416014)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RumwmWphBVA3nd04yJabYWeQTq5ehcVlEfZBB2+iuPYAiX9iuLdNA5TlfMM11t1X1B5iPVv03j5fGLtlhd2DonU05BhztOcQaT/joR40AYFlZNDyhiORkM33uYlVV5ZN2x/+vqY4tmaK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gRReL5S0B4r6401COE4/PKN/X/uHKV38zy0VWScAhMZexg6TZAJFw56uRSXu7fc5y+iihId1yTTeRGHV+KUb6EK+lSHNQ6Lmo8Sm8GwnhUGFc5vacO3ZtT5O/OIU0t5bbOlWFikgi7jm6zhM6Rsf5t+KOhOjpXzXknlUfGXcMejmau2Rs2UcVi9Ov7juB+W3wZYp4QouiF03jvwggreoRQpBKt0bccuNOSnDXjJNkXOH16yvuSAjBQrDEzSQND6bCDxbUQI0JVfyKcG5ixGJsBnh13djbZjyvDNRFgiYG3n/MVx0U2qqHIDM27aEYkIFJZvhFRjUQl+kFfmKUkq67xypIRVjz6FVLqEKfLo9/iE5uM1GFCCEoYfSSyYgwJ1gvuWIUYECbT6yljCF+mT9nbVWLhkNa4QKvA= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 625349f4-7eb5-40e2-c536-08dccca86a5f X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2024 06:11:29.2297 (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: LlqHHXx3lXzIUJ9N6reTFt9tjeTV2aae23StDOX4cQ6WU77N3McY59yTRA2eisp+gP4t6QmhizsgbZT2qUxyc2Mi0sspkL7/wY5imkGPn3ljr4EAFoYv8jxYB5iob3MK X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB7309 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240904_071211_015239_30B4FA0B X-CRM114-Status: GOOD ( 14.29 ) 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 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; }