From nobody Wed Dec 17 11:32:40 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1E4CCDB47E for ; Fri, 20 Oct 2023 09:51:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376763AbjJTJvX (ORCPT ); Fri, 20 Oct 2023 05:51:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376736AbjJTJvP (ORCPT ); Fri, 20 Oct 2023 05:51:15 -0400 Received: from mg.richtek.com (mg.richtek.com [220.130.44.152]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 305691A6 for ; Fri, 20 Oct 2023 02:51:09 -0700 (PDT) X-MailGates: (SIP:2,PASS,NONE)(compute_score:DELIVER,40,3) Received: from 192.168.10.46 by mg.richtek.com with MailGates ESMTPS Server V6.0(1461660:0:AUTH_RELAY) (envelope-from ) (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256/256); Fri, 20 Oct 2023 17:50:37 +0800 (CST) Received: from ex4.rt.l (192.168.10.47) by ex3.rt.l (192.168.10.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.25; Fri, 20 Oct 2023 17:50:36 +0800 Received: from linuxcarl2.richtek.com (192.168.10.154) by ex4.rt.l (192.168.10.45) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Fri, 20 Oct 2023 17:50:36 +0800 From: To: Mark Brown CC: Liam Girdwood , Jaroslav Kysela , Takashi Iwai , ChiYuan Huang , Allen Lin , , Subject: [PATCH 1/3] ASoC: codecs: rtq9128: Fix string compare in DAPM event callback Date: Fri, 20 Oct 2023 17:50:33 +0800 Message-ID: <1697795435-5858-2-git-send-email-cy_huang@richtek.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1697795435-5858-1-git-send-email-cy_huang@richtek.com> References: <1697795435-5858-1-git-send-email-cy_huang@richtek.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: ChiYuan Huang 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 --- 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_dap= m_widget *w, struct snd_kco =20 dev_dbg(comp->dev, "%s: %s event %d\n", __func__, w->name, event); =20 - if (strcmp(w->name, "DAC1") =3D=3D 0) + if (strstr(w->name, "DAC1")) shift =3D 6; - else if (strcmp(w->name, "DAC2") =3D=3D 0) + else if (strstr(w->name, "DAC2")) shift =3D 4; - else if (strcmp(w->name, "DAC3") =3D=3D 0) + else if (strstr(w->name, "DAC3")) shift =3D 2; else shift =3D 0; --=20 2.34.1