[PATCH v2] ASoC: dapm-graph: Handle sound card with space in name

Yiwei Lin posted 1 patch 1 month, 1 week ago
tools/sound/dapm-graph | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH v2] ASoC: dapm-graph: Handle sound card with space in name
Posted by Yiwei Lin 1 month, 1 week ago
When the name of the sound card has a space
between, the script will fail to output the
dot file. Consider the case to generate it
correctly.

Signed-off-by: Yiwei Lin <s921975628@gmail.com>
---
 tools/sound/dapm-graph | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/sound/dapm-graph b/tools/sound/dapm-graph
index b6196ee50..22993317d 100755
--- a/tools/sound/dapm-graph
+++ b/tools/sound/dapm-graph
@@ -174,7 +174,7 @@ process_dapm_component()
 
 	# Extract directory name into component name:
 	#   "./cs42l51.0-004a/dapm" -> "cs42l51.0-004a"
-	c_name="$(basename $(dirname "${c_dir}"))"
+	c_name="$(basename "$(dirname "${c_dir}")")"
     fi
 
     dbg_echo " * Component: ${c_name}"
@@ -201,7 +201,7 @@ process_dapm_component()
     >"${links_file}"
 
     # Iterate over widgets in the component dir
-    for w_file in ${c_dir}/*; do
+    for w_file in "${c_dir}"/*; do
 	process_dapm_widget "${tmp_dir}" "${c_name}" "${w_file}"
     done
 
-- 
2.34.1
Re: [PATCH v2] ASoC: dapm-graph: Handle sound card with space in name
Posted by Luca Ceresoli 1 month, 1 week ago
On Fri Nov 7, 2025 at 6:13 PM CET, Yiwei Lin wrote:
> When the name of the sound card has a space
> between, the script will fail to output the
> dot file. Consider the case to generate it
> correctly.
>
> Signed-off-by: Yiwei Lin <s921975628@gmail.com>

Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com