Skip to content

Commit a4854d1

Browse files
committed
ASoC: Intel: sof_sdw: Don't bother to set platform string
The static platform_component name string is overwritten on card tear down which will cause a NULL check on it to fail when the driver is reprobed. However, it turns out that the ASoC core sets this string for all topology systems anyway (after the aforementioned NULL check). So there is no need for the machine driver to set the platform at all, replace all the platform_component stuff with some simple place holders. Fixes: 52db12d ("ASoC: Intel: boards: add sof_sdw machine driver") Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
1 parent ce862b3 commit a4854d1

1 file changed

Lines changed: 11 additions & 14 deletions

File tree

sound/soc/intel/boards/sof_sdw.c

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -799,13 +799,6 @@ static void sof_sdw_check_ssid_quirk(const struct snd_soc_acpi_mach *mach)
799799
sof_sdw_quirk = quirk_entry->value;
800800
}
801801

802-
static struct snd_soc_dai_link_component platform_component[] = {
803-
{
804-
/* name might be overridden during probe */
805-
.name = "0000:00:1f.3"
806-
}
807-
};
808-
809802
static const struct snd_soc_ops sdw_ops = {
810803
.startup = asoc_sdw_startup,
811804
.prepare = asoc_sdw_prepare,
@@ -855,6 +848,7 @@ static int create_sdw_dailink(struct snd_soc_card *card,
855848
struct snd_soc_dai_link_ch_map *codec_maps;
856849
struct snd_soc_dai_link_component *codecs;
857850
struct snd_soc_dai_link_component *cpus;
851+
struct snd_soc_dai_link_component *platform;
858852
int num_cpus = hweight32(sof_dai->link_mask[stream]);
859853
int num_codecs = sof_dai->num_devs[stream];
860854
int playback, capture;
@@ -895,6 +889,10 @@ static int create_sdw_dailink(struct snd_soc_card *card,
895889
if (!codecs)
896890
return -ENOMEM;
897891

892+
platform = devm_kzalloc(dev, sizeof(*platform), GFP_KERNEL);
893+
if (!platform)
894+
return -ENOMEM;
895+
898896
codec_maps = devm_kcalloc(dev, num_codecs, sizeof(*codec_maps), GFP_KERNEL);
899897
if (!codec_maps)
900898
return -ENOMEM;
@@ -936,8 +934,7 @@ static int create_sdw_dailink(struct snd_soc_card *card,
936934
capture = (stream == SNDRV_PCM_STREAM_CAPTURE);
937935

938936
asoc_sdw_init_dai_link(dev, *dai_links, be_id, name, playback, capture,
939-
cpus, num_cpus, platform_component,
940-
ARRAY_SIZE(platform_component), codecs, num_codecs,
937+
cpus, num_cpus, platform, 1, codecs, num_codecs,
941938
1, asoc_sdw_rtd_init, &sdw_ops);
942939

943940
/*
@@ -1013,7 +1010,7 @@ static int create_ssp_dailinks(struct snd_soc_card *card,
10131010

10141011
ret = asoc_sdw_init_simple_dai_link(dev, *dai_links, be_id, name,
10151012
playback, capture, cpu_dai_name,
1016-
platform_component->name, codec_name,
1013+
"dummy", codec_name,
10171014
ssp_info->dais[0].dai_name, 1, NULL,
10181015
ssp_info->ops);
10191016
if (ret)
@@ -1037,7 +1034,7 @@ static int create_dmic_dailinks(struct snd_soc_card *card,
10371034

10381035
ret = asoc_sdw_init_simple_dai_link(dev, *dai_links, be_id, "dmic01",
10391036
0, 1, // DMIC only supports capture
1040-
"DMIC01 Pin", platform_component->name,
1037+
"DMIC01 Pin", "dummy",
10411038
"dmic-codec", "dmic-hifi", 1,
10421039
asoc_sdw_dmic_init, NULL);
10431040
if (ret)
@@ -1047,7 +1044,7 @@ static int create_dmic_dailinks(struct snd_soc_card *card,
10471044

10481045
ret = asoc_sdw_init_simple_dai_link(dev, *dai_links, be_id, "dmic16k",
10491046
0, 1, // DMIC only supports capture
1050-
"DMIC16k Pin", platform_component->name,
1047+
"DMIC16k Pin", "dummy",
10511048
"dmic-codec", "dmic-hifi", 1,
10521049
/* don't call asoc_sdw_dmic_init() twice */
10531050
NULL, NULL);
@@ -1090,7 +1087,7 @@ static int create_hdmi_dailinks(struct snd_soc_card *card,
10901087

10911088
ret = asoc_sdw_init_simple_dai_link(dev, *dai_links, be_id, name,
10921089
1, 0, // HDMI only supports playback
1093-
cpu_dai_name, platform_component->name,
1090+
cpu_dai_name, "dummy",
10941091
codec_name, codec_dai_name, 1,
10951092
i == 0 ? sof_sdw_hdmi_init : NULL, NULL);
10961093
if (ret)
@@ -1116,7 +1113,7 @@ static int create_bt_dailinks(struct snd_soc_card *card,
11161113
int ret;
11171114

11181115
ret = asoc_sdw_init_simple_dai_link(dev, *dai_links, be_id, name,
1119-
1, 1, cpu_dai_name, platform_component->name,
1116+
1, 1, cpu_dai_name, "dummy",
11201117
snd_soc_dummy_dlc.name, snd_soc_dummy_dlc.dai_name,
11211118
1, NULL, NULL);
11221119
if (ret)

0 commit comments

Comments
 (0)