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

ASoC: soc.h: convert asoc_xxx() to snd_soc_xxx()

ASoC is using 2 type of prefix (asoc_xxx() vs snd_soc_xxx()), but there
is no particular reason about that [1].
To reduce confusing, standarding these to snd_soc_xxx() is sensible.

This patch adds asoc_xxx() macro to keep compatible for a while.
It will be removed if all drivers were switched to new style.

Link: https://lore.kernel.org/r/87h6td3hus.wl-kuninori.morimoto.gx@renesas.com [1]
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87fs3ks26i.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Kuninori Morimoto and committed by
Mark Brown
1d5a2b5d 39fce972

+32 -18
+2 -2
include/sound/soc-card.h
··· 115 115 struct snd_soc_pcm_runtime *rtd; 116 116 117 117 for_each_card_rtds(card, rtd) { 118 - if (!strcmp(asoc_rtd_to_codec(rtd, 0)->name, dai_name)) 119 - return asoc_rtd_to_codec(rtd, 0); 118 + if (!strcmp(snd_soc_rtd_to_codec(rtd, 0)->name, dai_name)) 119 + return snd_soc_rtd_to_codec(rtd, 0); 120 120 } 121 121 122 122 return NULL;
+28 -14
include/sound/soc.h
··· 775 775 #endif 776 776 }; 777 777 778 + /* REMOVE ME */ 779 + #define asoc_link_to_cpu snd_soc_link_to_cpu 780 + #define asoc_link_to_codec snd_soc_link_to_codec 781 + #define asoc_link_to_platform snd_soc_link_to_platform 782 + 778 783 static inline struct snd_soc_dai_link_component* 779 - asoc_link_to_cpu(struct snd_soc_dai_link *link, int n) { 784 + snd_soc_link_to_cpu(struct snd_soc_dai_link *link, int n) { 780 785 return &(link)->cpus[n]; 781 786 } 782 787 783 788 static inline struct snd_soc_dai_link_component* 784 - asoc_link_to_codec(struct snd_soc_dai_link *link, int n) { 789 + snd_soc_link_to_codec(struct snd_soc_dai_link *link, int n) { 785 790 return &(link)->codecs[n]; 786 791 } 787 792 788 793 static inline struct snd_soc_dai_link_component* 789 - asoc_link_to_platform(struct snd_soc_dai_link *link, int n) { 794 + snd_soc_link_to_platform(struct snd_soc_dai_link *link, int n) { 790 795 return &(link)->platforms[n]; 791 796 } 792 797 793 798 #define for_each_link_codecs(link, i, codec) \ 794 799 for ((i) = 0; \ 795 800 ((i) < link->num_codecs) && \ 796 - ((codec) = asoc_link_to_codec(link, i)); \ 801 + ((codec) = snd_soc_link_to_codec(link, i)); \ 797 802 (i)++) 798 803 799 804 #define for_each_link_platforms(link, i, platform) \ 800 805 for ((i) = 0; \ 801 806 ((i) < link->num_platforms) && \ 802 - ((platform) = asoc_link_to_platform(link, i)); \ 807 + ((platform) = snd_soc_link_to_platform(link, i)); \ 803 808 (i)++) 804 809 805 810 #define for_each_link_cpus(link, i, cpu) \ 806 811 for ((i) = 0; \ 807 812 ((i) < link->num_cpus) && \ 808 - ((cpu) = asoc_link_to_cpu(link, i)); \ 813 + ((cpu) = snd_soc_link_to_cpu(link, i)); \ 809 814 (i)++) 810 815 811 816 /* ··· 896 891 #define COMP_CODEC_CONF(_name) { .name = _name } 897 892 #define COMP_DUMMY() { .name = "snd-soc-dummy", .dai_name = "snd-soc-dummy-dai", } 898 893 894 + /* REMOVE ME */ 895 + #define asoc_dummy_dlc snd_soc_dummy_dlc 896 + 899 897 extern struct snd_soc_dai_link_component null_dailink_component[0]; 900 - extern struct snd_soc_dai_link_component asoc_dummy_dlc; 898 + extern struct snd_soc_dai_link_component snd_soc_dummy_dlc; 901 899 902 900 903 901 struct snd_soc_codec_conf { ··· 1118 1110 * dais = cpu_dai + codec_dai 1119 1111 * see 1120 1112 * soc_new_pcm_runtime() 1121 - * asoc_rtd_to_cpu() 1122 - * asoc_rtd_to_codec() 1113 + * snd_soc_rtd_to_cpu() 1114 + * snd_soc_rtd_to_codec() 1123 1115 */ 1124 1116 struct snd_soc_dai **dais; 1125 1117 ··· 1145 1137 int num_components; 1146 1138 struct snd_soc_component *components[]; /* CPU/Codec/Platform */ 1147 1139 }; 1140 + 1141 + /* REMOVE ME */ 1142 + #define asoc_rtd_to_cpu snd_soc_rtd_to_cpu 1143 + #define asoc_rtd_to_codec snd_soc_rtd_to_codec 1144 + #define asoc_substream_to_rtd snd_soc_substream_to_rtd 1145 + 1148 1146 /* see soc_new_pcm_runtime() */ 1149 - #define asoc_rtd_to_cpu(rtd, n) (rtd)->dais[n] 1150 - #define asoc_rtd_to_codec(rtd, n) (rtd)->dais[n + (rtd)->dai_link->num_cpus] 1151 - #define asoc_substream_to_rtd(substream) \ 1147 + #define snd_soc_rtd_to_cpu(rtd, n) (rtd)->dais[n] 1148 + #define snd_soc_rtd_to_codec(rtd, n) (rtd)->dais[n + (rtd)->dai_link->num_cpus] 1149 + #define snd_soc_substream_to_rtd(substream) \ 1152 1150 (struct snd_soc_pcm_runtime *)snd_pcm_substream_chip(substream) 1153 1151 1154 1152 #define for_each_rtd_components(rtd, i, component) \ ··· 1163 1149 (i)++) 1164 1150 #define for_each_rtd_cpu_dais(rtd, i, dai) \ 1165 1151 for ((i) = 0; \ 1166 - ((i) < rtd->dai_link->num_cpus) && ((dai) = asoc_rtd_to_cpu(rtd, i)); \ 1152 + ((i) < rtd->dai_link->num_cpus) && ((dai) = snd_soc_rtd_to_cpu(rtd, i)); \ 1167 1153 (i)++) 1168 1154 #define for_each_rtd_codec_dais(rtd, i, dai) \ 1169 1155 for ((i) = 0; \ 1170 - ((i) < rtd->dai_link->num_codecs) && ((dai) = asoc_rtd_to_codec(rtd, i)); \ 1156 + ((i) < rtd->dai_link->num_codecs) && ((dai) = snd_soc_rtd_to_codec(rtd, i)); \ 1171 1157 (i)++) 1172 1158 #define for_each_rtd_dais(rtd, i, dai) \ 1173 1159 for ((i) = 0; \
+2 -2
sound/soc/soc-utils.c
··· 225 225 (component->driver == &dummy_codec)); 226 226 } 227 227 228 - struct snd_soc_dai_link_component asoc_dummy_dlc = { 228 + struct snd_soc_dai_link_component snd_soc_dummy_dlc = { 229 229 .of_node = NULL, 230 230 .dai_name = "snd-soc-dummy-dai", 231 231 .name = "snd-soc-dummy", 232 232 }; 233 - EXPORT_SYMBOL_GPL(asoc_dummy_dlc); 233 + EXPORT_SYMBOL_GPL(snd_soc_dummy_dlc); 234 234 235 235 static int snd_soc_dummy_probe(struct platform_device *pdev) 236 236 {