Unverified Commit 22a507d7 authored by Shengjiu Wang's avatar Shengjiu Wang Committed by Mark Brown
Browse files

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: default avatarShengjiu Wang <shengjiu.wang@nxp.com>
Acked-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/20251229090432.3964848-1-shengjiu.wang@nxp.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 12cacdfb
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1179,9 +1179,9 @@ void graph_util_parse_link_direction(struct device_node *np,
	bool is_playback_only = of_property_read_bool(np, "playback-only");
	bool is_capture_only  = of_property_read_bool(np, "capture-only");

	if (playback_only)
	if (np && playback_only)
		*playback_only = is_playback_only;
	if (capture_only)
	if (np && capture_only)
		*capture_only = is_capture_only;
}
EXPORT_SYMBOL_GPL(graph_util_parse_link_direction);