[alsa-devel] [asoc:for-4.20 519/524] sound/soc//stm/stm32_sai_sub.c:379:2: error: unknown field 'recalc_rate' specified in initializer
kbuild test robot
lkp at intel.com
Fri Oct 19 21:51:57 CEST 2018
tree: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-4.20
head: 318e741ee13b5a72f3051d9bb6852b1f4d02d0bb
commit: 8307b2afd386ccce369821daa2196068c47fe8cd [519/524] ASoC: stm32: sai: set sai as mclk clock provider
config: openrisc-allyesconfig (attached as .config)
compiler: or1k-linux-gcc (GCC) 6.0.0 20160327 (experimental)
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 8307b2afd386ccce369821daa2196068c47fe8cd
# save the attached .config to linux build tree
make.cross ARCH=openrisc
All errors (new ones prefixed by >>):
sound/soc//stm/stm32_sai_sub.c:260:16: error: field 'hw' has incomplete type
struct clk_hw hw;
^~
In file included from include/linux/err.h:5:0,
from include/linux/clk.h:15,
from sound/soc//stm/stm32_sai_sub.c:19:
sound/soc//stm/stm32_sai_sub.c: In function 'stm32_sai_mclk_round_rate':
include/linux/kernel.h:997:32: error: dereferencing pointer to incomplete type 'struct clk_hw'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^~~~~~
include/linux/compiler.h:335:18: note: in definition of macro '__compiletime_assert'
int __cond = !(condition); \
^~~~~~~~~
include/linux/compiler.h:358:2: note: in expansion of macro '_compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:45:37: note: in expansion of macro 'compiletime_assert'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^~~~~~~~~~~~~~~~~~
include/linux/kernel.h:997:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^~~~~~~~~~~~~~~~
include/linux/kernel.h:997:20: note: in expansion of macro '__same_type'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^~~~~~~~~~~
sound/soc//stm/stm32_sai_sub.c:265:27: note: in expansion of macro 'container_of'
#define to_mclk_data(_hw) container_of(_hw, struct stm32_sai_mclk_data, hw)
^~~~~~~~~~~~
sound/soc//stm/stm32_sai_sub.c:313:37: note: in expansion of macro 'to_mclk_data'
struct stm32_sai_mclk_data *mclk = to_mclk_data(hw);
^~~~~~~~~~~~
sound/soc//stm/stm32_sai_sub.c: At top level:
sound/soc//stm/stm32_sai_sub.c:376:21: error: variable 'mclk_ops' has initializer but incomplete type
static const struct clk_ops mclk_ops = {
^~~~~~~
>> sound/soc//stm/stm32_sai_sub.c:377:2: error: unknown field 'enable' specified in initializer
.enable = stm32_sai_mclk_enable,
^
sound/soc//stm/stm32_sai_sub.c:377:12: warning: excess elements in struct initializer
.enable = stm32_sai_mclk_enable,
^~~~~~~~~~~~~~~~~~~~~
sound/soc//stm/stm32_sai_sub.c:377:12: note: (near initialization for 'mclk_ops')
>> sound/soc//stm/stm32_sai_sub.c:378:2: error: unknown field 'disable' specified in initializer
.disable = stm32_sai_mclk_disable,
^
sound/soc//stm/stm32_sai_sub.c:378:13: warning: excess elements in struct initializer
.disable = stm32_sai_mclk_disable,
^~~~~~~~~~~~~~~~~~~~~~
sound/soc//stm/stm32_sai_sub.c:378:13: note: (near initialization for 'mclk_ops')
>> sound/soc//stm/stm32_sai_sub.c:379:2: error: unknown field 'recalc_rate' specified in initializer
.recalc_rate = stm32_sai_mclk_recalc_rate,
^
sound/soc//stm/stm32_sai_sub.c:379:17: warning: excess elements in struct initializer
.recalc_rate = stm32_sai_mclk_recalc_rate,
^~~~~~~~~~~~~~~~~~~~~~~~~~
sound/soc//stm/stm32_sai_sub.c:379:17: note: (near initialization for 'mclk_ops')
>> sound/soc//stm/stm32_sai_sub.c:380:2: error: unknown field 'round_rate' specified in initializer
.round_rate = stm32_sai_mclk_round_rate,
^
sound/soc//stm/stm32_sai_sub.c:380:16: warning: excess elements in struct initializer
.round_rate = stm32_sai_mclk_round_rate,
^~~~~~~~~~~~~~~~~~~~~~~~~
sound/soc//stm/stm32_sai_sub.c:380:16: note: (near initialization for 'mclk_ops')
>> sound/soc//stm/stm32_sai_sub.c:381:2: error: unknown field 'set_rate' specified in initializer
.set_rate = stm32_sai_mclk_set_rate,
^
sound/soc//stm/stm32_sai_sub.c:381:14: warning: excess elements in struct initializer
.set_rate = stm32_sai_mclk_set_rate,
^~~~~~~~~~~~~~~~~~~~~~~
sound/soc//stm/stm32_sai_sub.c:381:14: note: (near initialization for 'mclk_ops')
sound/soc//stm/stm32_sai_sub.c: In function 'stm32_sai_add_mclk_provider':
>> sound/soc//stm/stm32_sai_sub.c:389:22: error: implicit declaration of function '__clk_get_name' [-Werror=implicit-function-declaration]
const char *pname = __clk_get_name(sai->sai_ck);
^~~~~~~~~~~~~~
sound/soc//stm/stm32_sai_sub.c:389:22: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
>> sound/soc//stm/stm32_sai_sub.c:414:18: error: implicit declaration of function 'CLK_HW_INIT' [-Werror=implicit-function-declaration]
mclk->hw.init = CLK_HW_INIT(mclk_name, pname, &mclk_ops, 0);
^~~~~~~~~~~
>> sound/soc//stm/stm32_sai_sub.c:419:8: error: implicit declaration of function 'devm_clk_hw_register' [-Werror=implicit-function-declaration]
ret = devm_clk_hw_register(&sai->pdev->dev, hw);
^~~~~~~~~~~~~~~~~~~~
>> sound/soc//stm/stm32_sai_sub.c:427:9: error: implicit declaration of function 'devm_of_clk_add_hw_provider' [-Werror=implicit-function-declaration]
return devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, hw);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> sound/soc//stm/stm32_sai_sub.c:427:42: error: 'of_clk_hw_simple_get' undeclared (first use in this function)
return devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, hw);
^~~~~~~~~~~~~~~~~~~~
sound/soc//stm/stm32_sai_sub.c:427:42: note: each undeclared identifier is reported only once for each function it appears in
sound/soc//stm/stm32_sai_sub.c: At top level:
sound/soc//stm/stm32_sai_sub.c:376:29: error: storage size of 'mclk_ops' isn't known
static const struct clk_ops mclk_ops = {
^~~~~~~~
sound/soc//stm/stm32_sai_sub.c: In function 'stm32_sai_add_mclk_provider':
sound/soc//stm/stm32_sai_sub.c:428:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
cc1: some warnings being treated as errors
vim +/recalc_rate +379 sound/soc//stm/stm32_sai_sub.c
309
310 static long stm32_sai_mclk_round_rate(struct clk_hw *hw, unsigned long rate,
311 unsigned long *prate)
312 {
> 313 struct stm32_sai_mclk_data *mclk = to_mclk_data(hw);
314 struct stm32_sai_sub_data *sai = mclk->sai_data;
315 int div;
316
317 div = stm32_sai_get_clk_div(sai, *prate, rate);
318 if (div < 0)
319 return div;
320
321 mclk->freq = *prate / div;
322
323 return mclk->freq;
324 }
325
326 static unsigned long stm32_sai_mclk_recalc_rate(struct clk_hw *hw,
327 unsigned long parent_rate)
328 {
329 struct stm32_sai_mclk_data *mclk = to_mclk_data(hw);
330
331 return mclk->freq;
332 }
333
334 static int stm32_sai_mclk_set_rate(struct clk_hw *hw, unsigned long rate,
335 unsigned long parent_rate)
336 {
337 struct stm32_sai_mclk_data *mclk = to_mclk_data(hw);
338 struct stm32_sai_sub_data *sai = mclk->sai_data;
339 unsigned int div;
340 int ret;
341
342 div = stm32_sai_get_clk_div(sai, parent_rate, rate);
343 if (div < 0)
344 return div;
345
346 ret = stm32_sai_set_clk_div(sai, div);
347 if (ret)
348 return ret;
349
350 mclk->freq = rate;
351
352 return 0;
353 }
354
355 static int stm32_sai_mclk_enable(struct clk_hw *hw)
356 {
357 struct stm32_sai_mclk_data *mclk = to_mclk_data(hw);
358 struct stm32_sai_sub_data *sai = mclk->sai_data;
359
360 dev_dbg(&sai->pdev->dev, "Enable master clock\n");
361
362 return regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX,
363 SAI_XCR1_MCKEN, SAI_XCR1_MCKEN);
364 }
365
366 static void stm32_sai_mclk_disable(struct clk_hw *hw)
367 {
368 struct stm32_sai_mclk_data *mclk = to_mclk_data(hw);
369 struct stm32_sai_sub_data *sai = mclk->sai_data;
370
371 dev_dbg(&sai->pdev->dev, "Disable master clock\n");
372
373 regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX, SAI_XCR1_MCKEN, 0);
374 }
375
376 static const struct clk_ops mclk_ops = {
> 377 .enable = stm32_sai_mclk_enable,
> 378 .disable = stm32_sai_mclk_disable,
> 379 .recalc_rate = stm32_sai_mclk_recalc_rate,
> 380 .round_rate = stm32_sai_mclk_round_rate,
> 381 .set_rate = stm32_sai_mclk_set_rate,
382 };
383
384 static int stm32_sai_add_mclk_provider(struct stm32_sai_sub_data *sai)
385 {
386 struct clk_hw *hw;
387 struct stm32_sai_mclk_data *mclk;
388 struct device *dev = &sai->pdev->dev;
> 389 const char *pname = __clk_get_name(sai->sai_ck);
390 char *mclk_name, *p, *s = (char *)pname;
391 int ret, i = 0;
392
393 mclk = devm_kzalloc(dev, sizeof(mclk), GFP_KERNEL);
394 if (!mclk)
395 return -ENOMEM;
396
397 mclk_name = devm_kcalloc(dev, sizeof(char),
398 SAI_MCLK_NAME_LEN, GFP_KERNEL);
399 if (!mclk_name)
400 return -ENOMEM;
401
402 /*
403 * Forge mclk clock name from parent clock name and suffix.
404 * String after "_" char is stripped in parent name.
405 */
406 p = mclk_name;
407 while (*s && *s != '_' && (i < (SAI_MCLK_NAME_LEN - 6))) {
408 *p++ = *s++;
409 i++;
410 }
411 STM_SAI_IS_SUB_A(sai) ?
412 strncat(p, "a_mclk", 6) : strncat(p, "b_mclk", 6);
413
> 414 mclk->hw.init = CLK_HW_INIT(mclk_name, pname, &mclk_ops, 0);
415 mclk->sai_data = sai;
416 hw = &mclk->hw;
417
418 dev_dbg(dev, "Register master clock %s\n", mclk_name);
> 419 ret = devm_clk_hw_register(&sai->pdev->dev, hw);
420 if (ret) {
421 dev_err(dev, "mclk register returned %d\n", ret);
422 return ret;
423 }
424 sai->sai_mclk = hw->clk;
425
426 /* register mclk provider */
> 427 return devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, hw);
428 }
429
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 46618 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20181020/68bbbb72/attachment-0001.bin>
More information about the Alsa-devel
mailing list