Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: simple-card-utils: Check device node before overwrite direction

Even the device node don't exist, the graph_util_parse_link_direction()
will overwrite the playback_only and capture_only to be zero. Which
cause the playback_only and capture_only are not correct, so check device
node exist or not before update the value.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/20251229090432.3964848-1-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Shengjiu Wang and committed by
Mark Brown
22a507d7 12cacdfb

+2 -2
+2 -2
sound/soc/generic/simple-card-utils.c
··· 1179 1179 bool is_playback_only = of_property_read_bool(np, "playback-only"); 1180 1180 bool is_capture_only = of_property_read_bool(np, "capture-only"); 1181 1181 1182 - if (playback_only) 1182 + if (np && playback_only) 1183 1183 *playback_only = is_playback_only; 1184 - if (capture_only) 1184 + if (np && capture_only) 1185 1185 *capture_only = is_capture_only; 1186 1186 } 1187 1187 EXPORT_SYMBOL_GPL(graph_util_parse_link_direction);