Skip to content

Commit 22a507d

Browse files
TE-N-ShengjiuWangbroonie
authored andcommitted
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>
1 parent 12cacdf commit 22a507d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

sound/soc/generic/simple-card-utils.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,9 +1179,9 @@ void graph_util_parse_link_direction(struct device_node *np,
11791179
bool is_playback_only = of_property_read_bool(np, "playback-only");
11801180
bool is_capture_only = of_property_read_bool(np, "capture-only");
11811181

1182-
if (playback_only)
1182+
if (np && playback_only)
11831183
*playback_only = is_playback_only;
1184-
if (capture_only)
1184+
if (np && capture_only)
11851185
*capture_only = is_capture_only;
11861186
}
11871187
EXPORT_SYMBOL_GPL(graph_util_parse_link_direction);

0 commit comments

Comments
 (0)