Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Cezary Rojewski <cezary.rojewski@intel.com>
To: broonie@kernel.org
Cc: tiwai@suse.com, perex@perex.cz,
	amadeuszx.slawinski@linux.intel.com, nathan@kernel.org,
	linux-sound@vger.kernel.org,
	Cezary Rojewski <cezary.rojewski@intel.com>
Subject: [PATCH 01/17] ASoC: Intel: avs: hda: Adjust platform name
Date: Tue,  2 Sep 2025 11:48:37 +0200	[thread overview]
Message-ID: <20250902094853.1231842-2-cezary.rojewski@intel.com> (raw)
In-Reply-To: <20250902094853.1231842-1-cezary.rojewski@intel.com>

The name of the platform component matches the name of the card's
platform_device.

This allows for simplifying card and dai_link initialization:
- drop mach->mach_params.platform usage
- drop snd_soc_fixup_dai_links_platform_name() usage

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
---
 sound/soc/intel/avs/boards/hdaudio.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/sound/soc/intel/avs/boards/hdaudio.c b/sound/soc/intel/avs/boards/hdaudio.c
index 19b2255a8ac3..aec769e2396c 100644
--- a/sound/soc/intel/avs/boards/hdaudio.c
+++ b/sound/soc/intel/avs/boards/hdaudio.c
@@ -16,7 +16,7 @@
 #include "../utils.h"
 
 static int avs_create_dai_links(struct device *dev, struct hda_codec *codec, int pcm_count,
-				const char *platform_name, struct snd_soc_dai_link **links)
+				struct snd_soc_dai_link **links)
 {
 	struct snd_soc_dai_link_component *platform;
 	struct snd_soc_dai_link *dl;
@@ -29,7 +29,7 @@ static int avs_create_dai_links(struct device *dev, struct hda_codec *codec, int
 	if (!dl || !platform)
 		return -ENOMEM;
 
-	platform->name = platform_name;
+	platform->name = dev_name(dev);
 	pcm = list_first_entry(&codec->pcm_list_head, struct hda_pcm, list);
 
 	for (i = 0; i < pcm_count; i++, pcm = list_next_entry(pcm, list)) {
@@ -142,7 +142,7 @@ static int avs_probing_link_init(struct snd_soc_pcm_runtime *rtm)
 	list_for_each_entry(pcm, &codec->pcm_list_head, list)
 		pcm_count++;
 
-	ret = avs_create_dai_links(card->dev, codec, pcm_count, mach->mach_params.platform, &links);
+	ret = avs_create_dai_links(card->dev, codec, pcm_count, &links);
 	if (ret < 0) {
 		dev_err(card->dev, "create links failed: %d\n", ret);
 		return ret;
@@ -197,7 +197,7 @@ static int avs_hdaudio_probe(struct platform_device *pdev)
 	if (!binder->codecs->name)
 		return -ENOMEM;
 
-	binder->platforms->name = mach->mach_params.platform;
+	binder->platforms->name = dev_name(dev);
 	binder->num_platforms = 1;
 	binder->codecs->dai_name = "codec-probing-DAI";
 	binder->num_codecs = 1;
@@ -207,7 +207,10 @@ static int avs_hdaudio_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	if (pdata->obsolete_card_names) {
-		card->name = binder->codecs->name;
+		card->name = devm_kasprintf(dev, GFP_KERNEL, "hdaudioB%dD%d", codec->bus->core.idx,
+					    codec->core.addr);
+		if (!card->name)
+			return -ENOMEM;
 	} else {
 		card->driver_name = "avs_hdaudio";
 		if (hda_codec_is_display(codec))
-- 
2.25.1


  reply	other threads:[~2025-09-02  9:28 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-02  9:48 [PATCH 00/17] ASoC: Intel: avs: Adjust platform names Cezary Rojewski
2025-09-02  9:48 ` Cezary Rojewski [this message]
2025-09-02  9:48 ` [PATCH 02/17] ASoC: Intel: avs: da7219: Adjust platform name Cezary Rojewski
2025-09-02  9:48 ` [PATCH 03/17] ASoC: Intel: avs: dmic: Refactor dai_link creation Cezary Rojewski
2025-09-02  9:48 ` [PATCH 04/17] ASoC: Intel: avs: es8336: Adjust platform name Cezary Rojewski
2025-09-02  9:48 ` [PATCH 05/17] ASoC: Intel: avs: i2stest: " Cezary Rojewski
2025-09-02  9:48 ` [PATCH 06/17] ASoC: Intel: avs: max98357a: " Cezary Rojewski
2025-09-02  9:48 ` [PATCH 07/17] ASoC: Intel: avs: max98373: " Cezary Rojewski
2025-09-02  9:48 ` [PATCH 08/17] ASoC: Intel: avs: max98927: " Cezary Rojewski
2025-09-02  9:48 ` [PATCH 09/17] ASoC: Intel: avs: nau8825: " Cezary Rojewski
2025-09-02  9:48 ` [PATCH 10/17] ASoC: Intel: avs: probe: Refactor dai_link creation Cezary Rojewski
2025-09-02  9:48 ` [PATCH 11/17] ASoC: Intel: avs: rt274: Adjust platform name Cezary Rojewski
2025-09-02  9:48 ` [PATCH 12/17] ASoC: Intel: avs: rt286: " Cezary Rojewski
2025-09-02  9:48 ` [PATCH 13/17] ASoC: Intel: avs: rt298: " Cezary Rojewski
2025-09-02  9:48 ` [PATCH 14/17] ASoC: Intel: avs: rt5514: " Cezary Rojewski
2025-09-02  9:48 ` [PATCH 15/17] ASoC: Intel: avs: rt5663: " Cezary Rojewski
2025-09-02  9:48 ` [PATCH 16/17] ASoC: Intel: avs: rt5682: " Cezary Rojewski
2025-09-02  9:48 ` [PATCH 17/17] ASoC: Intel: avs: ssm4567: " Cezary Rojewski
2025-09-02 21:20 ` [PATCH 00/17] ASoC: Intel: avs: Adjust platform names Nathan Chancellor
2025-09-03 10:58 ` Mark Brown
2025-09-03 11:02   ` Amadeusz Sławiński
2025-09-03 18:53 ` Mark Brown

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=20250902094853.1231842-2-cezary.rojewski@intel.com \
    --to=cezary.rojewski@intel.com \
    --cc=amadeuszx.slawinski@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=nathan@kernel.org \
    --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