1. 03 Oct, 2019 3 commits
    • Kuninori Morimoto's avatar
      ASoC: soc-core: remove soc_remove_dai_links() · 7ce6088f
      Kuninori Morimoto authored
      It is easy to read code if it is cleanly using paired function/naming,
      like start <-> stop, register <-> unregister, etc, etc.
      But, current ALSA SoC code is very random, unbalance, not paired, etc.
      It is easy to create bug at the such code, and it will be difficult to
      debug.
      
      soc_cleanup_card_resources() (a) which is paired function of
      snd_soc_instantiate_card() (A) is calling soc_remove_dai_links() (*)
      to remove card related resources, but it is breaking
      add/remove balance (B)(b)(C)(c)(D)(d), in other words
      these should be called from soc_cleanup_card_resources() (a)
      from balance point of view.
      
      More headacke is that it is using original removing method for
      dai_link even though we already have snd_soc_remove_dai_link()
      which is the function for it (d).
      
      This patch removes snd_soc_remove_dai_links() and balance up code.
      
      	static void soc_remove_dai_links(...)
      	{
      		...
      (b)		soc_remove_link_dais(card);
      (c)		soc_remove_link_components(card);
      
      		for_each_card_links_safe(card, link, _link) {
      			...
      			/* it should use snd_soc_remove_dai_link() here */
      (d)			list_del(&link->list);
      		}
      	}
      
      (a)	static int soc_cleanup_card_resources(...)
      	{
      		...
      
      		/* remove and free each DAI */
      (*)		soc_remove_dai_links(card);
      		...
      	}
      
      (A)	static int snd_soc_instantiate_card(struct snd_soc_card *card)
      	{
      		...
      		/* add predefined DAI links to the list */
      		for_each_card_prelinks(card, i, dai_link)
      (B)			snd_soc_add_dai_link(card, dai_link);
      		...
      		/* probe all components used by DAI links on this card */
      (C)		ret = soc_probe_link_components(card);
      		...
      		/* probe all DAI links on this card */
      (D)		ret = soc_probe_link_dais(card);
      		...
      	}
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Link: https://lore.kernel.org/r/875zl7bu1r.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      7ce6088f
    • Kuninori Morimoto's avatar
      ASoC: soc-core: use devm_kzalloc() for rtd · 4dc0e7df
      Kuninori Morimoto authored
      Current rtd, rtd->dev, rtd->codec_dais are created by normal kzalloc(),
      but we want to use devm_kzalloc() as much as possible.
      
      Created rtd->dev is registered by device_register() at
      soc_new_pcm_runtime(), and it will be freed at
      soc_free_pcm_runtime() by device_unregister().
      
      This means, if we can use devm_kzalloc(rtd->dev, xxx) for
      rtd / rtd->codec_dais, all these are automatically freed
      via soc_free_pcm_runtime().
      This patch uses devm_kzalloc(rtd->dev, xxx) for rtd / rtd->codec_dais.
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Link: https://lore.kernel.org/r/877e5nbu1z.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      4dc0e7df
    • kbuild test robot's avatar
      tas2770: fix platform_no_drv_owner.cocci warnings · 5a742399
      kbuild test robot authored
      sound/soc/codecs/tas2770.c:796:3-8: No need to set .owner here. The core will do it.
      
       Remove .owner field if calls are used which set it automatically
      
      Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci
      
      Fixes: 1a476abc ("tas2770: add tas2770 smart PA kernel driver")
      CC: Frank Shi <shifu0704@thundersoft.com>
      Signed-off-by: default avatarkbuild test robot <lkp@intel.com>
      Link: https://lore.kernel.org/r/20191001175504.ufhyxh66psrht42k@332d0cec05f4Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      5a742399
  2. 02 Oct, 2019 4 commits
  3. 01 Oct, 2019 33 commits