mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-02-17 16:00:38 -05:00
ASoC: Intel: avs: rt5663: 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-16-cezary.rojewski@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
committed by
Mark Brown
parent
69fe78271d
commit
b0e52296aa
@@ -134,8 +134,8 @@ static const struct snd_soc_ops avs_rt5663_ops = {
|
||||
};
|
||||
|
||||
|
||||
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;
|
||||
@@ -145,8 +145,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);
|
||||
@@ -161,6 +159,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;
|
||||
@@ -202,18 +201,16 @@ static int avs_rt5663_probe(struct platform_device *pdev)
|
||||
struct snd_soc_card *card;
|
||||
struct rt5663_private *priv;
|
||||
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;
|
||||
|
||||
ret = avs_mach_get_ssp_tdm(dev, mach, &ssp_port, &tdm_slot);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
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", ret);
|
||||
return ret;
|
||||
@@ -245,10 +242,6 @@ static int avs_rt5663_probe(struct platform_device *pdev)
|
||||
card->fully_routed = true;
|
||||
snd_soc_card_set_drvdata(card, priv);
|
||||
|
||||
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