mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: <cy_huang@richtek.com>
To: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	ChiYuan Huang <cy_huang@richtek.com>,
	Allen Lin <allen_lin@richtek.com>, <alsa-devel@alsa-project.org>,
	<linux-kernel@vger.kernel.org>
Subject: [PATCH 1/3] ASoC: codecs: rtq9128: Fix string compare in DAPM event callback
Date: Fri, 20 Oct 2023 17:50:33 +0800	[thread overview]
Message-ID: <1697795435-5858-2-git-send-email-cy_huang@richtek.com> (raw)
In-Reply-To: <1697795435-5858-1-git-send-email-cy_huang@richtek.com>

From: ChiYuan Huang <cy_huang@richtek.com>

Since widget name may concatenate the component prefix. To compare the
the name with 'strcmp' function in shared DAPM event callback will
cause the wrong RG field control. Use 'strstr' function, instead.

Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
---
 sound/soc/codecs/rtq9128.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/rtq9128.c b/sound/soc/codecs/rtq9128.c
index 371d622c6214..8c1c3c65475e 100644
--- a/sound/soc/codecs/rtq9128.c
+++ b/sound/soc/codecs/rtq9128.c
@@ -291,11 +291,11 @@ static int rtq9128_dac_power_event(struct snd_soc_dapm_widget *w, struct snd_kco
 
 	dev_dbg(comp->dev, "%s: %s event %d\n", __func__, w->name, event);
 
-	if (strcmp(w->name, "DAC1") == 0)
+	if (strstr(w->name, "DAC1"))
 		shift = 6;
-	else if (strcmp(w->name, "DAC2") == 0)
+	else if (strstr(w->name, "DAC2"))
 		shift = 4;
-	else if (strcmp(w->name, "DAC3") == 0)
+	else if (strstr(w->name, "DAC3"))
 		shift = 2;
 	else
 		shift = 0;
-- 
2.34.1


  reply	other threads:[~2023-10-20  9:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-20  9:50 [PATCH 0/3] ASoC: codecs: rtq9128: Several application fixes cy_huang
2023-10-20  9:50 ` cy_huang [this message]
2023-10-31  9:45   ` [PATCH 1/3] ASoC: codecs: rtq9128: Fix string compare in DAPM event callback ChiYuan Huang
2023-10-20  9:50 ` [PATCH 2/3] ASoC: codecs: rtq9128: Fix TDM enable and DAI format control flow cy_huang
2023-10-20  9:50 ` [PATCH 3/3] ASoC: codecs: rtq9128: Fix TKA470B E1 version amp on sequence cy_huang

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=1697795435-5858-2-git-send-email-cy_huang@richtek.com \
    --to=cy_huang@richtek.com \
    --cc=allen_lin@richtek.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®