From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1B85ECD342C for ; Tue, 5 May 2026 02:21:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=unmh/NzLauaJRbPvFNyUmXNZp8PhEMfuHX3iK6/vqVY=; b=TK35f7Gq/+jXBAYbse400eF6rx fWPwgKodXXkm2WJMZXLPzskKwq3r0w9tFdlhuk2iv1M/2A8g5bQe7WhViw5tUiMLuUpOeWh6ACczX G88G1Z3GZ8GgKLcOV4CiL1m1zdTjc8YW017oiCwHm5huaeM0bV8p83DBWb7Iyd4+UK17bkw7D54er 17Cz7W/JFTAeY0bVMHzPT75CTGIh301cEeaMcOG+DeJJcAIqn6Xbt/X/vDNAKuqotY5wl2JbiGhPZ CDxJBO4kz45wpFeP44vwrbHlatGP12QiYM4e8ejaykWAvvkqWx5k2WC/JlngF+9YkYGAYLLbRQ+Je 5UQlwdvg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1wK5PY-0000000EtfK-0ZTN; Tue, 05 May 2026 02:21:24 +0000 Received: from sea.source.kernel.org ([172.234.252.31]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1wK5PW-0000000Eteq-1Ocn for linux-arm-kernel@lists.infradead.org; Tue, 05 May 2026 02:21:23 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id C2EBD4451E; Tue, 5 May 2026 02:21:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86AE0C2BCB8; Tue, 5 May 2026 02:21:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777947681; bh=JO2IMv4fsRX0ZcyGTHisLvXxtyNEwmC3NfmP+6npWNk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YhViaJCnZ9Iqwy4eVh+l7NLp5EUAgIDkA7qwztzRtOqY3Ju4IaOnqMoidw5NLSn8q 6m6WfGoxc/ZpKHOWKBmFoSq9bV3nbO3t7ikomujp8b+jM8QkXUH9Db16fgn3PTpJ8P 7g4k1zRU0ITLxxrrM1x5rUpU1p6uI68qWt4lZtASPF7ruQUc8Xu7buLCt7kXCXGNQy tbbHU3DWLoalLFOKt+jB4jn3Tt9L6g/fq+bERDHLb+1IeeFHXDk4r+M2B1jQwCpdmV ke79exptDwH95rFi/UDlLZS+/+7unvKCTRc8+XmouyppdN0nPVHg+Lum2/drHPxY+N LYw3CMXgAjU3g== Received: by finisterre.sirena.org.uk (Postfix, from userid 1000) id 6D4FE1AC5871; Tue, 05 May 2026 03:21:19 +0100 (BST) Date: Tue, 5 May 2026 11:21:19 +0900 From: Mark Brown To: Chancel Liu Cc: lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, nicoleotsuka@gmail.com, Frank.Li@nxp.com, s.hauer@pengutronix.de, kernel@pengutronix.de, shumingf@realtek.com, rander.wang@linux.intel.com, pierre-louis.bossart@linux.dev, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v3 1/3] ASoC: dapm: Fix widget lookup with snd_soc_dapm_widget_name_cmp() Message-ID: References: <20260429021252.691263-1-chancel.liu@nxp.com> <20260429021252.691263-2-chancel.liu@nxp.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="H51FCLIJf4TpdLl7" Content-Disposition: inline In-Reply-To: <20260429021252.691263-2-chancel.liu@nxp.com> X-Cookie: Alex Haley was adopted! X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260504_192122_390943_5A1ACE07 X-CRM114-Status: GOOD ( 17.01 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --H51FCLIJf4TpdLl7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 29, 2026 at 11:12:50AM +0900, Chancel Liu wrote: > Currently dapm_find_widget() manually constructs a prefixed widget name > based on the provided DAPM context and compares it using strcmp(). This > happens to work in most cases because callers usually know which DAPM > context the target widget belongs to and pass in the matching DAPM > context. > - if (prefix) { > - snprintf(prefixed_pin, sizeof(prefixed_pin), "%s %s", > - prefix, pin); > - pin_name =3D prefixed_pin; > - } else { > - pin_name =3D pin; > - } > =20 > for_each_card_widgets(dapm->card, w) { > - if (!strcmp(w->name, pin_name)) { > + if (!snd_soc_dapm_widget_name_cmp(w, pin)) { > if (w->dapm =3D=3D dapm) > return w; > else This means we can't use the prefix to disambiguate any more - snd_soc_dapm_widget_name_cmp() will strip the prefix off. We want the prefix in contexts where the name is specified by the user since the prefix is there to provide for disambiguation. The prefix addition logic is a bit weird and I'm not sure it makes sense, but the search based on the fully specified name we got is something we want. --H51FCLIJf4TpdLl7 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmn5VB4ACgkQJNaLcl1U h9CupAf+MGqhy9yn/GtWv68HU9M+CSI26hbO/33u6YCfbI8rVD5r3sVvsPny+nIS Hjcpp4SW27502ByKDEE/6t2CNSBpJS0Z3YbgVr/nlsyhs9zVFbvBb3W0BTO10USD 1cZyS1qeifNAglMYVM8zaR0YIHll+5NWVR4kQr2mVyOt6rOlfa6gVQWBpl5QlJbY 327ly0J96cBfeR/Irzq0/ya89I4HPIJuCRuIpn8MJBWY/cvQl6l87qWAVoDpk0wX RTTkhF/PhREqDYMSDame5+VnaEqr2PJXZgu/MJlpOOgAHWaApnmfnVM62sUZXfkg POV16q9CbmYfk2lJbW1huCz+h5xygg== =YkxC -----END PGP SIGNATURE----- --H51FCLIJf4TpdLl7--