[SRU,Focal,2/3] ASoC: DMI long name - avoid to add board name if matches with product name
diff mbox series

Message ID 20200211031252.6620-3-hui.wang@canonical.com
State New
Headers show
  • change the ASoC card name and card longname to meet the requirement of alsa-lib-1.2.1 (Focal)
Related show

Commit Message

Hui Wang Feb. 11, 2020, 3:12 a.m. UTC
From: Jaroslav Kysela <perex@perex.cz>

BugLink: https://launchpad.net/bugs/1862712

Current code:


With the patch:


Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20191120174435.30920-2-perex@perex.cz
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 39870b0dec68ed7dd814beb697e541670975c7d8)
Signed-off-by: Hui Wang <hui.wang@canonical.com>
 sound/soc/soc-core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff mbox series

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index c57363059f89..423e59ea2069 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1809,7 +1809,8 @@  int snd_soc_set_dmi_name(struct snd_soc_card *card, const char *flavour)
 	board = dmi_get_system_info(DMI_BOARD_NAME);
 	if (board && is_dmi_valid(board)) {
-		append_dmi_string(card, board);
+		if (!product || strcasecmp(board, product))
+			append_dmi_string(card, board);
 	} else if (!product) {
 		/* fall back to using legacy name */
 		dev_warn(card->dev, "ASoC: no DMI board/product name!\n");