Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: remove unnecessary dai_link->platform

Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Current ASoC will ignore already connected component when binding Card.
This will happen mainly "CPU Component" is handled as "Platform Component",
which was needed before.

static int snd_soc_rtd_add_component(...)
{
...
for_each_rtd_components(rtd, i, comp) {
/* already connected */
if (comp == component)
return 0;
}
...
}

Some drivers are still using CPU or Dummy Component as Platform Component,
but these are no meaning or ignored.
This patch-set remove these.

+10 -32
+1 -4
sound/soc/atmel/atmel-classd.c
··· 473 473 if (!dai_link) 474 474 return -ENOMEM; 475 475 476 - comp = devm_kzalloc(dev, 3 * sizeof(*comp), GFP_KERNEL); 476 + comp = devm_kzalloc(dev, 2 * sizeof(*comp), GFP_KERNEL); 477 477 if (!comp) 478 478 return -ENOMEM; 479 479 480 480 dai_link->cpus = &comp[0]; 481 481 dai_link->codecs = &comp[1]; 482 - dai_link->platforms = &comp[2]; 483 482 484 483 dai_link->num_cpus = 1; 485 484 dai_link->num_codecs = 1; 486 - dai_link->num_platforms = 1; 487 485 488 486 dai_link->name = "CLASSD"; 489 487 dai_link->stream_name = "CLASSD PCM"; 490 488 dai_link->codecs->dai_name = "snd-soc-dummy-dai"; 491 489 dai_link->cpus->dai_name = dev_name(dev); 492 490 dai_link->codecs->name = "snd-soc-dummy"; 493 - dai_link->platforms->name = dev_name(dev); 494 491 495 492 card->dai_link = dai_link; 496 493 card->num_links = 1;
+1 -4
sound/soc/atmel/atmel-pdmic.c
··· 496 496 if (!dai_link) 497 497 return -ENOMEM; 498 498 499 - comp = devm_kzalloc(dev, 3 * sizeof(*comp), GFP_KERNEL); 499 + comp = devm_kzalloc(dev, 2 * sizeof(*comp), GFP_KERNEL); 500 500 if (!comp) 501 501 return -ENOMEM; 502 502 503 503 dai_link->cpus = &comp[0]; 504 504 dai_link->codecs = &comp[1]; 505 - dai_link->platforms = &comp[2]; 506 505 507 506 dai_link->num_cpus = 1; 508 507 dai_link->num_codecs = 1; 509 - dai_link->num_platforms = 1; 510 508 511 509 dai_link->name = "PDMIC"; 512 510 dai_link->stream_name = "PDMIC PCM"; 513 511 dai_link->codecs->dai_name = "snd-soc-dummy-dai"; 514 512 dai_link->cpus->dai_name = dev_name(dev); 515 513 dai_link->codecs->name = "snd-soc-dummy"; 516 - dai_link->platforms->name = dev_name(dev); 517 514 518 515 card->dai_link = dai_link; 519 516 card->num_links = 1;
+4 -10
sound/soc/fsl/imx-audmix.c
··· 207 207 for (i = 0; i < num_dai; i++) { 208 208 struct snd_soc_dai_link_component *dlc; 209 209 210 - /* for CPU/Codec/Platform x 2 */ 211 - dlc = devm_kcalloc(&pdev->dev, 6, sizeof(*dlc), GFP_KERNEL); 210 + /* for CPU/Codec x 2 */ 211 + dlc = devm_kcalloc(&pdev->dev, 4, sizeof(*dlc), GFP_KERNEL); 212 212 if (!dlc) 213 213 return -ENOMEM; 214 214 ··· 240 240 241 241 priv->dai[i].cpus = &dlc[0]; 242 242 priv->dai[i].codecs = &dlc[1]; 243 - priv->dai[i].platforms = &dlc[2]; 244 243 245 244 priv->dai[i].num_cpus = 1; 246 245 priv->dai[i].num_codecs = 1; 247 - priv->dai[i].num_platforms = 1; 248 246 249 247 priv->dai[i].name = dai_name; 250 248 priv->dai[i].stream_name = "HiFi-AUDMIX-FE"; ··· 250 252 priv->dai[i].codecs->name = "snd-soc-dummy"; 251 253 priv->dai[i].cpus->of_node = args.np; 252 254 priv->dai[i].cpus->dai_name = dev_name(&cpu_pdev->dev); 253 - priv->dai[i].platforms->of_node = args.np; 254 255 priv->dai[i].dynamic = 1; 255 256 priv->dai[i].dpcm_playback = 1; 256 257 priv->dai[i].dpcm_capture = (i == 0 ? 1 : 0); ··· 264 267 be_cp = devm_kasprintf(&pdev->dev, GFP_KERNEL, 265 268 "AUDMIX-Capture-%d", i); 266 269 267 - priv->dai[num_dai + i].cpus = &dlc[3]; 268 - priv->dai[num_dai + i].codecs = &dlc[4]; 269 - priv->dai[num_dai + i].platforms = &dlc[5]; 270 + priv->dai[num_dai + i].cpus = &dlc[2]; 271 + priv->dai[num_dai + i].codecs = &dlc[3]; 270 272 271 273 priv->dai[num_dai + i].num_cpus = 1; 272 274 priv->dai[num_dai + i].num_codecs = 1; 273 - priv->dai[num_dai + i].num_platforms = 1; 274 275 275 276 priv->dai[num_dai + i].name = be_name; 276 277 priv->dai[num_dai + i].codecs->dai_name = "snd-soc-dummy-dai"; 277 278 priv->dai[num_dai + i].codecs->name = "snd-soc-dummy"; 278 279 priv->dai[num_dai + i].cpus->of_node = audmix_np; 279 280 priv->dai[num_dai + i].cpus->dai_name = be_name; 280 - priv->dai[num_dai + i].platforms->name = "snd-soc-dummy"; 281 281 priv->dai[num_dai + i].no_pcm = 1; 282 282 priv->dai[num_dai + i].dpcm_playback = 1; 283 283 priv->dai[num_dai + i].dpcm_capture = 1;
+1 -4
sound/soc/fsl/imx-spdif.c
··· 26 26 } 27 27 28 28 data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); 29 - comp = devm_kzalloc(&pdev->dev, 3 * sizeof(*comp), GFP_KERNEL); 29 + comp = devm_kzalloc(&pdev->dev, 2 * sizeof(*comp), GFP_KERNEL); 30 30 if (!data || !comp) { 31 31 ret = -ENOMEM; 32 32 goto end; ··· 34 34 35 35 data->dai.cpus = &comp[0]; 36 36 data->dai.codecs = &comp[1]; 37 - data->dai.platforms = &comp[2]; 38 37 39 38 data->dai.num_cpus = 1; 40 39 data->dai.num_codecs = 1; 41 - data->dai.num_platforms = 1; 42 40 43 41 data->dai.name = "S/PDIF PCM"; 44 42 data->dai.stream_name = "S/PDIF PCM"; 45 43 data->dai.codecs->dai_name = "snd-soc-dummy-dai"; 46 44 data->dai.codecs->name = "snd-soc-dummy"; 47 45 data->dai.cpus->of_node = spdif_np; 48 - data->dai.platforms->of_node = spdif_np; 49 46 data->dai.playback_only = true; 50 47 data->dai.capture_only = true; 51 48
+2 -6
sound/soc/soc-topology.c
··· 1685 1685 struct snd_soc_dai_link_component *dlc; 1686 1686 int ret; 1687 1687 1688 - /* link + cpu + codec + platform */ 1689 - link = devm_kzalloc(tplg->dev, sizeof(*link) + (3 * sizeof(*dlc)), GFP_KERNEL); 1688 + /* link + cpu + codec */ 1689 + link = devm_kzalloc(tplg->dev, sizeof(*link) + (2 * sizeof(*dlc)), GFP_KERNEL); 1690 1690 if (link == NULL) 1691 1691 return -ENOMEM; 1692 1692 ··· 1694 1694 1695 1695 link->cpus = &dlc[0]; 1696 1696 link->codecs = &dlc[1]; 1697 - link->platforms = &dlc[2]; 1698 1697 1699 1698 link->num_cpus = 1; 1700 1699 link->num_codecs = 1; 1701 - link->num_platforms = 1; 1702 1700 1703 1701 link->dobj.index = tplg->index; 1704 1702 link->dobj.type = SND_SOC_DOBJ_DAI_LINK; ··· 1723 1725 1724 1726 link->codecs->name = "snd-soc-dummy"; 1725 1727 link->codecs->dai_name = "snd-soc-dummy-dai"; 1726 - 1727 - link->platforms->name = "snd-soc-dummy"; 1728 1728 1729 1729 /* enable DPCM */ 1730 1730 link->dynamic = 1;
+1 -4
sound/soc/ti/omap-hdmi.c
··· 365 365 if (!card->dai_link) 366 366 return -ENOMEM; 367 367 368 - compnent = devm_kzalloc(dev, 3 * sizeof(*compnent), GFP_KERNEL); 368 + compnent = devm_kzalloc(dev, 2 * sizeof(*compnent), GFP_KERNEL); 369 369 if (!compnent) 370 370 return -ENOMEM; 371 371 card->dai_link->cpus = &compnent[0]; 372 372 card->dai_link->num_cpus = 1; 373 373 card->dai_link->codecs = &compnent[1]; 374 374 card->dai_link->num_codecs = 1; 375 - card->dai_link->platforms = &compnent[2]; 376 - card->dai_link->num_platforms = 1; 377 375 378 376 card->dai_link->name = card->name; 379 377 card->dai_link->stream_name = card->name; 380 378 card->dai_link->cpus->dai_name = dev_name(ad->dssdev); 381 - card->dai_link->platforms->name = dev_name(ad->dssdev); 382 379 card->dai_link->codecs->name = "snd-soc-dummy"; 383 380 card->dai_link->codecs->dai_name = "snd-soc-dummy-dai"; 384 381 card->num_links = 1;