Re: [PATCH v5 09/14] ASoC: simple-card-utils: add asoc_simple_card_parse_graph_dai()
From: kbuild test robot
Date: Sun Nov 27 2016 - 22:34:21 EST
Hi Kuninori,
[auto build test ERROR on robh/for-next]
[also build test ERROR on v4.9-rc7]
[cannot apply to glikely/devicetree/next asoc/for-next next-20161125]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Kuninori-Morimoto/ASoC-add-OF-graph-base-simple-card/20161128-111639
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: i386-randconfig-x002-201648 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All errors (new ones prefixed by >>):
sound/soc/generic/simple-card-utils.c: In function 'asoc_simple_card_parse_card_name':
sound/soc/generic/simple-card-utils.c:92:8: error: implicit declaration of function 'snd_soc_of_parse_card_name_from_node' [-Werror=implicit-function-declaration]
ret = snd_soc_of_parse_card_name_from_node(card, node, prop);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sound/soc/generic/simple-card-utils.c: In function 'asoc_simple_card_parse_graph_dai':
>> sound/soc/generic/simple-card-utils.c:210:9: error: implicit declaration of function 'snd_soc_get_dai_name' [-Werror=implicit-function-declaration]
ret = snd_soc_get_dai_name(&args, dai_name);
^~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/snd_soc_get_dai_name +210 sound/soc/generic/simple-card-utils.c
86 char prop[128];
87 int ret;
88
89 snprintf(prop, sizeof(prop), "%sname", prefix);
90
91 /* Parse the card name from DT */
> 92 ret = snd_soc_of_parse_card_name_from_node(card, node, prop);
93 if (ret < 0)
94 return ret;
95
96 if (!card->name && card->dai_link)
97 card->name = card->dai_link->name;
98
99 return 0;
100 }
101 EXPORT_SYMBOL_GPL(asoc_simple_card_parse_card_name);
102
103 int asoc_simple_card_parse_clk(struct device_node *node,
104 struct device_node *dai_of_node,
105 struct asoc_simple_dai *simple_dai)
106 {
107 struct clk *clk;
108 u32 val;
109
110 /*
111 * Parse dai->sysclk come from "clocks = <&xxx>"
112 * (if system has common clock)
113 * or "system-clock-frequency = <xxx>"
114 * or device's module clock.
115 */
116 clk = of_clk_get(node, 0);
117 if (!IS_ERR(clk)) {
118 simple_dai->sysclk = clk_get_rate(clk);
119 simple_dai->clk = clk;
120 } else if (!of_property_read_u32(node, "system-clock-frequency", &val)) {
121 simple_dai->sysclk = val;
122 } else {
123 clk = of_clk_get(dai_of_node, 0);
124 if (!IS_ERR(clk))
125 simple_dai->sysclk = clk_get_rate(clk);
126 }
127
128 return 0;
129 }
130 EXPORT_SYMBOL_GPL(asoc_simple_card_parse_clk);
131
132 int asoc_simple_card_parse_dai(struct device_node *node,
133 struct device_node **dai_of_node,
134 const char **dai_name,
135 const char *list_name,
136 const char *cells_name,
137 int *is_single_link)
138 {
139 struct of_phandle_args args;
140 int ret;
141
142 if (!node)
143 return 0;
144
145 /*
146 * Get node via "sound-dai = <&phandle port>"
147 * it will be used as xxx_of_node on soc_bind_dai_link()
148 */
149 ret = of_parse_phandle_with_args(node, list_name, cells_name, 0, &args);
150 if (ret)
151 return ret;
152
153 /* Get dai->name */
154 if (dai_name) {
155 ret = snd_soc_of_get_dai_name(node, dai_name);
156 if (ret < 0)
157 return ret;
158 }
159
160 *dai_of_node = args.np;
161
162 if (is_single_link)
163 *is_single_link = !args.args_count;
164
165 return 0;
166 }
167 EXPORT_SYMBOL_GPL(asoc_simple_card_parse_dai);
168
169 int asoc_simple_card_parse_graph_dai(struct device_node *ep,
170 struct device_node **dai_of_node,
171 const char **dai_name)
172 {
173 struct device_node *node, *port, *endpoint;
174 int i, id;
175
176 if (!ep)
177 return 0;
178
179 /*
180 * of_graph_get_port_parent() will call
181 * of_node_put(). So, call of_node_get() here
182 */
183 of_node_get(ep);
184 node = of_graph_get_port_parent(ep);
185
186 i = 0;
187 id = -1;
188 for_each_of_port(node, port) {
189 if (!of_graph_port_type_is_sound(port))
190 continue;
191
192 for_each_of_endpoint_in_port(port, endpoint) {
193 if (endpoint == ep)
194 id = i;
195 i++;
196 }
197 }
198 if (id < 0)
199 return -ENODEV;
200
201 /* Get dai->name */
202 if (dai_name) {
203 struct of_phandle_args args;
204 int ret;
205
206 args.np = node;
207 args.args[0] = id;
208 args.args_count = (i > 1);
209
> 210 ret = snd_soc_get_dai_name(&args, dai_name);
211 if (ret < 0)
212 return ret;
213 }
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip