mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Amadeusz Sławiński" <amade@asmblr.net>
To: linux-sound@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, "Mark Brown" <broonie@kernel.org>,
	"Jaroslav Kysela" <perex@perex.cz>,
	"Takashi Iwai" <tiwai@suse.com>,
	"Liam Girdwood" <lgirdwood@gmail.com>,
	"Amadeusz Sławiński" <amade@asmblr.net>,
	"kernel test robot" <lkp@intel.com>,
	"Dan Carpenter" <error27@gmail.com>
Subject: [PATCH] ASoC: soc-dapm: Remove overzealous check
Date: Mon, 19 Oct 2026 19:26:40 +0200	[thread overview]
Message-ID: <20261019172640.64989-1-amade@asmblr.net> (raw)

Widget is always constructed with dapm context, so this check is
superfluous and it also leads to warning from kernel test robot.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Closes: https://lore.kernel.org/r/202610180339.A6POXeNa-lkp@intel.com/
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
---
 sound/soc/soc-dapm.c | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 7455160b11fe..eff6103cb21b 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -2890,20 +2890,18 @@ void snd_soc_dapm_free_widget(struct snd_soc_dapm_widget *w)
 
 	dapm_debugfs_free_widget(w);
 
-	if (w->dapm) {
-		if (w->dapm->card) {
-			for_each_card_dapms(w->dapm->card, d) {
-				if (d->wcache_sink == w)
-					d->wcache_sink = NULL;
-				if (d->wcache_source == w)
-					d->wcache_source = NULL;
-			}
-		} else {
-			if (w->dapm->wcache_sink == w)
-				w->dapm->wcache_sink = NULL;
-			if (w->dapm->wcache_source == w)
-				w->dapm->wcache_source = NULL;
+	if (w->dapm->card) {
+		for_each_card_dapms(w->dapm->card, d) {
+			if (d->wcache_sink == w)
+				d->wcache_sink = NULL;
+			if (d->wcache_source == w)
+				d->wcache_source = NULL;
 		}
+	} else {
+		if (w->dapm->wcache_sink == w)
+			w->dapm->wcache_sink = NULL;
+		if (w->dapm->wcache_source == w)
+			w->dapm->wcache_source = NULL;
 	}
 
 	kfree(w->kcontrols);
-- 
2.56.0


                 reply	other threads:[~2026-10-19 17:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261019172640.64989-1-amade@asmblr.net \
    --to=amade@asmblr.net \
    --cc=broonie@kernel.org \
    --cc=error27@gmail.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=lkp@intel.com \
    --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®