未验证 提交 28735af3 编写于 作者: K KaiChieh Chuang 提交者: Mark Brown

ASoC: dapm: fix debugfs read using path->connected

This fix a bug in dapm_widget_power_read_file(),
where it may sent opposite order of source/sink widget
into the p->connected().

for example,
static int connected_check(source, sink);
{"w_sink", NULL, "w_source", connected_check}

the dapm_widget_power_read_file() will query p->connected()
in following case
	p->conneted("w_source", "w_sink")
	p->conneted("w_sink", "w_source")
we should avoid the last case, since it's the wrong order (source/sink)
as declared in snd_soc_dapm_route.
Signed-off-by: NKaiChieh Chuang <kaichieh.chuang@mediatek.com>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 4fbd8d19
......@@ -2026,7 +2026,7 @@ static ssize_t dapm_widget_power_read_file(struct file *file,
snd_soc_dapm_for_each_direction(dir) {
rdir = SND_SOC_DAPM_DIR_REVERSE(dir);
snd_soc_dapm_widget_for_each_path(w, dir, p) {
if (p->connected && !p->connected(w, p->node[rdir]))
if (p->connected && !p->connected(p->source, p->sink))
continue;
if (!p->connect)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册