mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	ASoC: meson: use snd_soc_{of_}get_dlc()
Current ASoC has snd_soc_{of_}get_dai_name() to get DAI name
for dlc (snd_soc_dai_link_component).
But we now can use snd_soc_{of_}get_dlc() for it. Let's use it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87legedgmy.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
			
			
This commit is contained in:
		
							parent
							
								
									6cf881b7f1
								
							
						
					
					
						commit
						2e1dbea1f8
					
				
					 4 changed files with 8 additions and 17 deletions
				
			
		| 
						 | 
					@ -319,8 +319,7 @@ static int axg_card_add_link(struct snd_soc_card *card, struct device_node *np,
 | 
				
			||||||
	dai_link->cpus = cpu;
 | 
						dai_link->cpus = cpu;
 | 
				
			||||||
	dai_link->num_cpus = 1;
 | 
						dai_link->num_cpus = 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ret = meson_card_parse_dai(card, np, &dai_link->cpus->of_node,
 | 
						ret = meson_card_parse_dai(card, np, dai_link->cpus);
 | 
				
			||||||
				   &dai_link->cpus->dai_name);
 | 
					 | 
				
			||||||
	if (ret)
 | 
						if (ret)
 | 
				
			||||||
		return ret;
 | 
							return ret;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -90,8 +90,7 @@ static int gx_card_add_link(struct snd_soc_card *card, struct device_node *np,
 | 
				
			||||||
	dai_link->cpus = cpu;
 | 
						dai_link->cpus = cpu;
 | 
				
			||||||
	dai_link->num_cpus = 1;
 | 
						dai_link->num_cpus = 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ret = meson_card_parse_dai(card, np, &dai_link->cpus->of_node,
 | 
						ret = meson_card_parse_dai(card, np, dai_link->cpus);
 | 
				
			||||||
				   &dai_link->cpus->dai_name);
 | 
					 | 
				
			||||||
	if (ret)
 | 
						if (ret)
 | 
				
			||||||
		return ret;
 | 
							return ret;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -74,23 +74,18 @@ EXPORT_SYMBOL_GPL(meson_card_reallocate_links);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int meson_card_parse_dai(struct snd_soc_card *card,
 | 
					int meson_card_parse_dai(struct snd_soc_card *card,
 | 
				
			||||||
			 struct device_node *node,
 | 
								 struct device_node *node,
 | 
				
			||||||
			 struct device_node **dai_of_node,
 | 
								 struct snd_soc_dai_link_component *dlc)
 | 
				
			||||||
			 const char **dai_name)
 | 
					 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct of_phandle_args args;
 | 
					 | 
				
			||||||
	int ret;
 | 
						int ret;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!dai_name || !dai_of_node || !node)
 | 
						if (!dlc || !node)
 | 
				
			||||||
		return -EINVAL;
 | 
							return -EINVAL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ret = of_parse_phandle_with_args(node, "sound-dai",
 | 
						ret = snd_soc_of_get_dlc(node, NULL, dlc, 0);
 | 
				
			||||||
					 "#sound-dai-cells", 0, &args);
 | 
					 | 
				
			||||||
	if (ret)
 | 
						if (ret)
 | 
				
			||||||
		return dev_err_probe(card->dev, ret, "can't parse dai\n");
 | 
							return dev_err_probe(card->dev, ret, "can't parse dai\n");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	*dai_of_node = args.np;
 | 
						return ret;
 | 
				
			||||||
 | 
					 | 
				
			||||||
	return snd_soc_get_dai_name(&args, dai_name);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
EXPORT_SYMBOL_GPL(meson_card_parse_dai);
 | 
					EXPORT_SYMBOL_GPL(meson_card_parse_dai);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -160,8 +155,7 @@ int meson_card_set_be_link(struct snd_soc_card *card,
 | 
				
			||||||
	link->num_codecs = num_codecs;
 | 
						link->num_codecs = num_codecs;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for_each_child_of_node(node, np) {
 | 
						for_each_child_of_node(node, np) {
 | 
				
			||||||
		ret = meson_card_parse_dai(card, np, &codec->of_node,
 | 
							ret = meson_card_parse_dai(card, np, codec);
 | 
				
			||||||
					   &codec->dai_name);
 | 
					 | 
				
			||||||
		if (ret) {
 | 
							if (ret) {
 | 
				
			||||||
			of_node_put(np);
 | 
								of_node_put(np);
 | 
				
			||||||
			return ret;
 | 
								return ret;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -39,8 +39,7 @@ int meson_card_reallocate_links(struct snd_soc_card *card,
 | 
				
			||||||
				unsigned int num_links);
 | 
									unsigned int num_links);
 | 
				
			||||||
int meson_card_parse_dai(struct snd_soc_card *card,
 | 
					int meson_card_parse_dai(struct snd_soc_card *card,
 | 
				
			||||||
			 struct device_node *node,
 | 
								 struct device_node *node,
 | 
				
			||||||
			 struct device_node **dai_of_node,
 | 
								 struct snd_soc_dai_link_component *dlc);
 | 
				
			||||||
			 const char **dai_name);
 | 
					 | 
				
			||||||
int meson_card_set_be_link(struct snd_soc_card *card,
 | 
					int meson_card_set_be_link(struct snd_soc_card *card,
 | 
				
			||||||
			   struct snd_soc_dai_link *link,
 | 
								   struct snd_soc_dai_link *link,
 | 
				
			||||||
			   struct device_node *node);
 | 
								   struct device_node *node);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue