All of lore.kernel.org
 help / color / mirror / Atom feed
From: <kaichieh.chuang@mediatek.com>
To: broonie@kernel.org
Cc: alsa-devel@alsa-project.org, chipeng.chang@mediatek.com,
	garlic.tseng@mediatek.com, srv_wsdupstream@mediatek.com,
	shane.chien@mediatek.com, linux-mediatek@lists.infradead.org,
	kaichieh.chuang@mediatek.com
Subject: [PATCH] ASoC: dapm: fix debugfs read using path->connected
Date: Fri, 2 Feb 2018 15:03:35 +0800	[thread overview]
Message-ID: <1517555015-19080-1-git-send-email-kaichieh.chuang@mediatek.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 2184 bytes --]

From: KaiChieh Chuang <kaichieh.chuang@mediatek.com>

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: KaiChieh Chuang <kaichieh.chuang@mediatek.com>
---
 sound/soc/soc-dapm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index a10b21c..ee6d9d9a 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -2026,7 +2026,7 @@ static ssize_t dapm_widget_power_read_file(struct file *fi
le,
        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)
--
1.7.9.5


************* Email Confidentiality Notice ********************
The information contained in this e-mail message (including any
attachments) may be confidential, proprietary, privileged, or otherwise
exempt from disclosure under applicable laws. It is intended to be
conveyed only to the designated recipient(s). Any use, dissemination,
distribution, printing, retaining or copying of this e-mail (including its
attachments) by unintended recipient(s) is strictly prohibited and may
be unlawful. If you are not an intended recipient of this e-mail, or believe
that you have received this e-mail in error, please notify the sender
immediately (by replying to this e-mail), delete any and all copies of
this e-mail (including any attachments) from your system, and do not
disclose the content of this e-mail to any other person. Thank you!

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



             reply	other threads:[~2018-02-02  7:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-02  7:03 kaichieh.chuang [this message]
2018-02-02 15:53 ` [PATCH] ASoC: dapm: fix debugfs read using path->connected Mark Brown
2018-02-05  1:00   ` KaiChieh Chuang
2018-02-05  4:56   ` KaiChieh Chuang
2018-02-05 11:31     ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1517555015-19080-1-git-send-email-kaichieh.chuang@mediatek.com \
    --to=kaichieh.chuang@mediatek.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=chipeng.chang@mediatek.com \
    --cc=garlic.tseng@mediatek.com \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=shane.chien@mediatek.com \
    --cc=srv_wsdupstream@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.