mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-02-18 01:20:26 -05:00
ASoC: Intel: avs: i2stest: Adjust platform name
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> Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Message-ID: <20250902094853.1231842-6-cezary.rojewski@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
committed by
Mark Brown
parent
cd405e6a94
commit
d4b60caaef
@@ -14,8 +14,8 @@
|
||||
#include <sound/soc-dapm.h>
|
||||
#include "../utils.h"
|
||||
|
||||
static int avs_create_dai_link(struct device *dev, const char *platform_name, int ssp_port,
|
||||
int tdm_slot, struct snd_soc_dai_link **dai_link)
|
||||
static int avs_create_dai_link(struct device *dev, int ssp_port, int tdm_slot,
|
||||
struct snd_soc_dai_link **dai_link)
|
||||
{
|
||||
struct snd_soc_dai_link_component *platform;
|
||||
struct snd_soc_dai_link *dl;
|
||||
@@ -25,8 +25,6 @@ static int avs_create_dai_link(struct device *dev, const char *platform_name, in
|
||||
if (!dl || !platform)
|
||||
return -ENOMEM;
|
||||
|
||||
platform->name = platform_name;
|
||||
|
||||
dl->name = devm_kasprintf(dev, GFP_KERNEL,
|
||||
AVS_STRING_FMT("SSP", "-Codec", ssp_port, tdm_slot));
|
||||
dl->cpus = devm_kzalloc(dev, sizeof(*dl->cpus), GFP_KERNEL);
|
||||
@@ -39,6 +37,7 @@ static int avs_create_dai_link(struct device *dev, const char *platform_name, in
|
||||
if (!dl->cpus->dai_name || !dl->codecs->name || !dl->codecs->dai_name)
|
||||
return -ENOMEM;
|
||||
|
||||
platform->name = dev_name(dev);
|
||||
dl->num_cpus = 1;
|
||||
dl->num_codecs = 1;
|
||||
dl->platforms = platform;
|
||||
@@ -59,11 +58,9 @@ static int avs_i2s_test_probe(struct platform_device *pdev)
|
||||
struct avs_mach_pdata *pdata;
|
||||
struct snd_soc_card *card;
|
||||
struct device *dev = &pdev->dev;
|
||||
const char *pname;
|
||||
int ssp_port, tdm_slot, ret;
|
||||
|
||||
mach = dev_get_platdata(dev);
|
||||
pname = mach->mach_params.platform;
|
||||
pdata = mach->pdata;
|
||||
|
||||
if (!avs_mach_singular_ssp(mach)) {
|
||||
@@ -94,7 +91,7 @@ static int avs_i2s_test_probe(struct platform_device *pdev)
|
||||
if (!card->name)
|
||||
return -ENOMEM;
|
||||
|
||||
ret = avs_create_dai_link(dev, pname, ssp_port, tdm_slot, &dai_link);
|
||||
ret = avs_create_dai_link(dev, ssp_port, tdm_slot, &dai_link);
|
||||
if (ret) {
|
||||
dev_err(dev, "Failed to create dai link: %d\n", ret);
|
||||
return ret;
|
||||
@@ -106,10 +103,6 @@ static int avs_i2s_test_probe(struct platform_device *pdev)
|
||||
card->num_links = 1;
|
||||
card->fully_routed = true;
|
||||
|
||||
ret = snd_soc_fixup_dai_links_platform_name(card, pname);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return devm_snd_soc_register_deferrable_card(dev, card);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user