From patchwork Tue May 28 05:05:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13676129 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 BADECC25B78 for ; Tue, 28 May 2024 05:07:55 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 073A3B65; Tue, 28 May 2024 07:07:44 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 073A3B65 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1716872874; bh=hMnHc2+T6ZG2QQNRc5URHQ9RccWTIk3bNSVwOUT/9tc=; h=From:Subject:To:Cc:In-Reply-To:References:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=EEE4o15CZy1HvqvatiC44aIouGhacvEA6j0X46ohZKULe823bwbzxg1xXkmiWjRjt aKaAQBoC1uhBVyMv6pHhytVTW/XyrLJdONE/Q/XqluZTngwUXnPDk8eOnLPWfO5Jh5 4aUgrGRjcB/RcFF9oMD1T92hAMnMotrILTlpuh68= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 69820F806AC; Tue, 28 May 2024 07:05:56 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 89B17F806B2; Tue, 28 May 2024 07:05:55 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D2D49F8065A; Tue, 28 May 2024 07:05:47 +0200 (CEST) Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazlp170110002.outbound.protection.outlook.com [IPv6:2a01:111:f403:c405::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C4166F8062F for ; Tue, 28 May 2024 07:05:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C4166F8062F Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=mUY0BMZv ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SXYWnK1j/d5saHjcSrwplYairmPXbMTyH3TpMNP+EgF8q/5S/wfP1vQ0Pi1ATl5QsFtZBLq6eBUD/c0aFwJn2GIkbDi+VFd+iq9hDopL5sZdZip7J3gq6rEjc3Lc2Q5pxOV5lOV3d8lHa+GRswvX769vgh4oJTg2tM+/Kbf278bHsG0Agela5sFgvd5Ies1ih8wDX5J4WhmbY1rHjyAUaWLe73Di0DmkdCZ6QyMW3s79Fy9Mcpsc/MUBRVtUDUhrhl3RYvWemtqM69sqmYcPW7882nj0n6o1/D7rPOi285o+QZPuCovfGxUROVRLlMj2R6fy/qKJfgj1/oyt/bfs0A== 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=YkXNiz/yOvSLYLfwiTDYiYo5tD5IN8kTEOF76BmRE8Y=; b=EgwO7BOc9DtVmtSJbAeHA4zDAljmrrz592WlRj6+ZP+dmgvajwJa+iWUUrtr46vWPH2GAXQLosK8ThHmKNCgQ0v9BExomcbBWSJ8ukqbNIwd9yjY8U0xPHpvUZZmmbtiVqnOJuUKl31xwken7axHoPnvU8Ow0GHLPEtgqKVqLfLfMv50TR5cgYE1ayAbwWsJRX7AZsPBjVJ5BXx098VSY4V+df2uWB7F0HtCLI5Fm2bnyMTAyiv26qv8hsCn13DbnQT96ILOLNG4LoKrKpgA/Fe0d/u3qyhRUOK70xcZxy/h88szUSXcSwFTVfdsxqVW5lZqdsX90l+ALuaUWB2jCw== 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=YkXNiz/yOvSLYLfwiTDYiYo5tD5IN8kTEOF76BmRE8Y=; b=mUY0BMZvTL8ugDMJGXAltrxUUJ/p8NHhUEnefyb6LbBnxW9dA55jbdkqe8cgAWvnewbLCGa8gYS1vL0Vxv/tGOAH5CmiP0tFWb+DTJyIe6jmu//xo67A5/qhvavY1f9pinKtAVCEweMCEHgP/jE8Fs4ICDmGGF04XFUHK8ou/sI= 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 TYCPR01MB7090.jpnprd01.prod.outlook.com (2603:1096:400:c1::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30; Tue, 28 May 2024 05:05:40 +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 05:05:40 +0000 Message-ID: <871q5mh6fv.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 07/11] ASoC: audio-graph-card: remove ports node name check User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Mark Brown Cc: Linux-ALSA In-Reply-To: <87bk4qh6h8.wl-kuninori.morimoto.gx@renesas.com> References: <87bk4qh6h8.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 28 May 2024 05:05:40 +0000 X-ClientProxiedBy: TYAPR01CA0240.jpnprd01.prod.outlook.com (2603:1096:404:11e::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_|TYCPR01MB7090:EE_ X-MS-Office365-Filtering-Correlation-Id: 2ef10c49-46b7-4815-97f3-08dc7ed3d1fa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|1800799015|52116005|366007|38350700005; X-Microsoft-Antispam-Message-Info: GPpchoIHFatVkyPS7s9T9gSDv3e5mba9NBWGGVh+O8TAeg42TSL6ZtdEMdbS1L7xB88ueCraTNVjXYtwmvojR70hqoqhwOxRL18jL5Y5HvvyiJo7Kcg7joQxdh+BMYhVysvR0uC/BIA/Dv5o9I5aOwyNYXBzaJkJ/P3tnkHApnnAkhqtq7dPrMF4ce78wKfRmBgKrEAY2fqd6aMCviyVfi+t2c1UuZJijJoSKZlI80/FuIreBKqgHjxm/JvmOBRwGfwjrGrITclsAcaYS1KmM7USKO06E9LnfNplryiIbseBkLK70zuYEMIEvxXurCkCPho2HjVVehQS0vSPbSQ6m2go+d11XWImhZXZeQyoYOzAXbvlNCcWTPS3PDh3T1wh7VqIgZ8OwMdYnok2fRN9WCSx+mxtK3gnEzklUv5FcBuLqEDpQrRD0gsgq3fx5qUVfiBBnORcMi/sqd37D1pSgQv5K9+xWqXgvEQTfEsqad5xDhQzCVXtMTzikm1SjKCX3Yo3PbHHuer8Lay6tR6Yu7UbfUqHKvbKws66Wr1tsGmrKgwTwqyQqxcOsWSaomL49aJ+DVoU8aDa4C++iigbPBRaVrhObbV8buKNTrfjJKYE9iOKLyBGblLdBl/Xtjo9h/scuMEUZrdNT/21GdMSqnPj6WJvuOsTWhymAxdEk0ZQl3bVQ9sgYUdDxx9RmZqtmySRxvt4gaBg7vBg0MiS/ohO436XxgH39GLT67T0zB3hrZaZ1froNnLm7J62PfKW6YQ1Cvv84t9/0yqT82sf4bGS/cKKCq0BbvkwwNlmvAb+M7x7HQuNVww3/ZTccoxLnUnQHFezpd2SBWdvUIyUjM4QZUy54+j+2OaQPexetKMrmzzqms4YvaMz8ePBqrj30B2/2Mzgydk/gwJ2RyQV3iB8H+/PPf2XiQMLrMCqC7Wdg4fzlYB1Srfmvj7hBVapQdUbDNoIM/EqwIpuwLxNqQnXraQJ0AUbdIEcqdaMCtgdlaYaL08p9s1w2IuBmN8+4q6LmzCmoIONF+4LJopDpw9XzGgWvBhRnU/gyKuRlVwDABIowZqHkpCY2O/lOeylfuWr4vXCZ5rgRzdqKfgHvvY9IAwE7bDyIs0+9Ft2JYkN8Pxtt0yCFWTJIqy6bg1YpuWMSIUwN9aPYY5ofXFGm0RsRufeIO3CXkM4fARlJ9HT87zKrrPbr1jNbWLkjUtYVRjgdZorNDhnv0hSXu6eK3v24MqbVBl5RW3RDtEZeKF82hcUKahLBxqttMzV09Xk2L7L26NOd5+rvp0o5mBnHa0xCYwdS03TOhIMnZdn6pTRDO6CcL4uqTzMW/0lfmTRURLcqh/QFYWIGtW5m+D6Hw== 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)(376005)(1800799015)(52116005)(366007)(38350700005);DIR:OUT;SFP:1101; X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VhFRPsCosfX34AGggWvA2nkj3p7Y6aF8JWIJaW3zayaf6OxcrIbx2fG/rF8SKwEhi1dHupBG7jgdTQU3la3sz6p+gC7RRaDNwNAl8TDTzcU54KzaKTu/cEuKlJ7hdo2maqXMBsVo2iIZSkboNuJFHH5ik9cBIc9GHuh3QAbmaa+0WTsDu/m5o0A0ptsSvta/p7qrwxhJ8hUyMF/F2uY+fjJ/cF6DtN+KREDllrxTZBk+MPC7dNKURlJOD+MxhcFd8siYRoo9wHfVWZ8Gd3nw49fU59Pd+NVJ0PrErpKUIL14QC0IDUIp/X8aKeIolm4mJL/wQMBQbmUubYi46w+RcY3Kpcw27eP77//H2/dUxkGsYN/7wB9VpYcQYiL3azcQBY/Eb+L+DfHpOCZKXd/I5K/tbuLiWkzhajKla+lJ8Sm+qKxOc/3iafqVcCDAQIZ21lG/wxKLPqmPlgyKWkP4j1XUDd7dA0iQu56VqhaQdji6byFx851byXOiO6bHQ64SW3tshDFF0xkw2AQvOTGRsWTBiIZ0sjMxr4MQeM7HGEOz7tS9+rbn7MtNhwwyfTCeQJR/KxsegdYV/FCdGggrNRbcU5wPJCWQVNMZ3Y2seeXKT31jXNyBqp8= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2ef10c49-46b7-4815-97f3-08dc7ed3d1fa X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 05:05:40.6906 (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: AWndcVQK9kXcuzB6m68xqXwC1FDlmQalCP/scWo+t3DR86azPbVStc/FlEoTssDKbbM6xfxY+MnBN41FZIiqi34x8s8ScHVRxhF/uDu8k91dFPG+eP/b1Za1XNsseYKh X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB7090 Message-ID-Hash: WAUO3HONECGVCHQ5IKA277HRNANQVH47 X-Message-ID-Hash: WAUO3HONECGVCHQ5IKA277HRNANQVH47 X-MailFrom: kuninori.morimoto.gx@renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Current audio-graph-card is checking if the node name was "ports" or not when parsing the property. if (of_node_name_eq(ports, "ports")) of_xxx(ports, ...); Now, it is using new port_to_ports() which will be NULL if the node doesn't have "ports", and each of_xxx functions will do nothing if node was NULL. Now we don't need to check ports node name. Let's remove and cleanup it. Signed-off-by: Kuninori Morimoto --- sound/soc/generic/audio-graph-card.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index 552b94908cf7c..c60f001468591 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -85,8 +85,7 @@ static void graph_parse_convert(struct device *dev, struct device_node *node = of_graph_get_port_parent(ep); simple_util_parse_convert(top, NULL, adata); - if (of_node_name_eq(ports, "ports")) - simple_util_parse_convert(ports, NULL, adata); + simple_util_parse_convert(ports, NULL, adata); simple_util_parse_convert(port, NULL, adata); simple_util_parse_convert(ep, NULL, adata); @@ -103,8 +102,7 @@ static void graph_parse_mclk_fs(struct device_node *top, struct device_node *ports = port_to_ports(port); of_property_read_u32(top, "mclk-fs", &props->mclk_fs); - if (of_node_name_eq(ports, "ports")) - of_property_read_u32(ports, "mclk-fs", &props->mclk_fs); + of_property_read_u32(ports, "mclk-fs", &props->mclk_fs); of_property_read_u32(port, "mclk-fs", &props->mclk_fs); of_property_read_u32(ep, "mclk-fs", &props->mclk_fs); @@ -245,12 +243,9 @@ static int graph_dai_link_of_dpcm(struct simple_util_priv *priv, /* check "prefix" from top node */ port = ep_to_port(ep); ports = port_to_ports(port); - snd_soc_of_parse_node_prefix(top, cconf, codecs->of_node, - "prefix"); - if (of_node_name_eq(ports, "ports")) - snd_soc_of_parse_node_prefix(ports, cconf, codecs->of_node, "prefix"); - snd_soc_of_parse_node_prefix(port, cconf, codecs->of_node, - "prefix"); + snd_soc_of_parse_node_prefix(top, cconf, codecs->of_node, "prefix"); + snd_soc_of_parse_node_prefix(ports, cconf, codecs->of_node, "prefix"); + snd_soc_of_parse_node_prefix(port, cconf, codecs->of_node, "prefix"); of_node_put(ports); of_node_put(port);