mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ASoC: soc-dapm: Remove overzealous check
@ 2026-10-19 17:26 Amadeusz Sławiński
  0 siblings, 0 replies; only message in thread
From: Amadeusz Sławiński @ 2026-10-19 17:26 UTC (permalink / raw)
  To: linux-sound
  Cc: linux-kernel, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Liam Girdwood, Amadeusz Sławiński, kernel test robot,
	Dan Carpenter

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-19 17:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-19 17:26 [PATCH] ASoC: soc-dapm: Remove overzealous check Amadeusz Sławiński

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®