lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241007-tegra-dapm-v1-1-bede7983fa76@skidata.com>
Date: Mon, 07 Oct 2024 10:12:30 +0200
From: Benjamin Bara <bbara93@...il.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>, 
 Liam Girdwood <lgirdwood@...il.com>, Mark Brown <broonie@...nel.org>, 
 Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>, 
 Thierry Reding <thierry.reding@...il.com>, 
 Jonathan Hunter <jonathanh@...dia.com>
Cc: linux-sound@...r.kernel.org, linux-tegra@...r.kernel.org, 
 linux-kernel@...r.kernel.org, Benjamin Bara <benjamin.bara@...data.com>, 
 stable@...r.kernel.org
Subject: [PATCH] Revert "ASoC: tegra: machine: Handle component name
 prefix"

From: Benjamin Bara <benjamin.bara@...data.com>

This reverts commit f82eb06a40c86c9a82537e956de401d497203d3a.

Tegra is adding the DAPM of the respective widgets directly to the card
and therefore the DAPM has no component. Without the component, the
precondition for snd_soc_dapm_to_component() fails, which results in
undefined behavior. Use the old implementation, as we cannot have a
prefix without component.

Cc: stable@...r.kernel.org # v6.7+
Signed-off-by: Benjamin Bara <benjamin.bara@...data.com>
---
Original Link:
https://lore.kernel.org/all/20231023095428.166563-18-krzysztof.kozlowski@linaro.org/
---
 sound/soc/tegra/tegra_asoc_machine.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/sound/soc/tegra/tegra_asoc_machine.c b/sound/soc/tegra/tegra_asoc_machine.c
index 775ce433fdbfdbcff4d09d078dbb0e65c0b15b60..bc16f805f52c41d6cb983380ee0ac40944531e52 100644
--- a/sound/soc/tegra/tegra_asoc_machine.c
+++ b/sound/soc/tegra/tegra_asoc_machine.c
@@ -81,23 +81,19 @@ static int tegra_machine_event(struct snd_soc_dapm_widget *w,
 	struct snd_soc_dapm_context *dapm = w->dapm;
 	struct tegra_machine *machine = snd_soc_card_get_drvdata(dapm->card);
 
-	if (!snd_soc_dapm_widget_name_cmp(w, "Int Spk") ||
-	    !snd_soc_dapm_widget_name_cmp(w, "Speakers"))
+	if (!strcmp(w->name, "Int Spk") || !strcmp(w->name, "Speakers"))
 		gpiod_set_value_cansleep(machine->gpiod_spkr_en,
 					 SND_SOC_DAPM_EVENT_ON(event));
 
-	if (!snd_soc_dapm_widget_name_cmp(w, "Mic Jack") ||
-	    !snd_soc_dapm_widget_name_cmp(w, "Headset Mic"))
+	if (!strcmp(w->name, "Mic Jack") || !strcmp(w->name, "Headset Mic"))
 		gpiod_set_value_cansleep(machine->gpiod_ext_mic_en,
 					 SND_SOC_DAPM_EVENT_ON(event));
 
-	if (!snd_soc_dapm_widget_name_cmp(w, "Int Mic") ||
-	    !snd_soc_dapm_widget_name_cmp(w, "Internal Mic 2"))
+	if (!strcmp(w->name, "Int Mic") || !strcmp(w->name, "Internal Mic 2"))
 		gpiod_set_value_cansleep(machine->gpiod_int_mic_en,
 					 SND_SOC_DAPM_EVENT_ON(event));
 
-	if (!snd_soc_dapm_widget_name_cmp(w, "Headphone") ||
-	    !snd_soc_dapm_widget_name_cmp(w, "Headphone Jack"))
+	if (!strcmp(w->name, "Headphone") || !strcmp(w->name, "Headphone Jack"))
 		gpiod_set_value_cansleep(machine->gpiod_hp_mute,
 					 !SND_SOC_DAPM_EVENT_ON(event));
 

---
base-commit: 8cf0b93919e13d1e8d4466eb4080a4c4d9d66d7b
change-id: 20241007-tegra-dapm-ef969b8f762a

Best regards,
-- 
Benjamin Bara <benjamin.bara@...data.com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ