[alsa-devel] [PATCH 1/1] ASoC: dwc: Use devm_ioremap_shared_resource
kbuild test robot
lkp at intel.com
Sun Feb 18 07:45:47 CET 2018
Hi Akshu,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on asoc/for-next]
[also build test ERROR on v4.16-rc1 next-20180216]
[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/Akshu-Agrawal/Use-of-shared-resource-in-designware/20180218-130807
base: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: x86_64-randconfig-g0-02181159 (attached as .config)
compiler: gcc-4.9 (Debian 4.9.4-2) 4.9.4
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
All errors (new ones prefixed by >>):
sound/soc/dwc/dwc-i2s.c: In function 'dw_i2s_probe':
>> sound/soc/dwc/dwc-i2s.c:642:5: error: implicit declaration of function 'devm_ioremap_shared_resource' [-Werror=implicit-function-declaration]
devm_ioremap_shared_resource(&pdev->dev, res);
^
sound/soc/dwc/dwc-i2s.c:641:18: warning: assignment makes pointer from integer without a cast
dev->i2s_base =
^
cc1: some warnings being treated as errors
vim +/devm_ioremap_shared_resource +642 sound/soc/dwc/dwc-i2s.c
613
614 static int dw_i2s_probe(struct platform_device *pdev)
615 {
616 const struct i2s_platform_data *pdata = pdev->dev.platform_data;
617 struct dw_i2s_dev *dev;
618 struct resource *res;
619 int ret, irq;
620 struct snd_soc_dai_driver *dw_i2s_dai;
621 const char *clk_id;
622
623 dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
624 if (!dev)
625 return -ENOMEM;
626
627 dw_i2s_dai = devm_kzalloc(&pdev->dev, sizeof(*dw_i2s_dai), GFP_KERNEL);
628 if (!dw_i2s_dai)
629 return -ENOMEM;
630
631 dw_i2s_dai->ops = &dw_i2s_dai_ops;
632 dw_i2s_dai->suspend = dw_i2s_suspend;
633 dw_i2s_dai->resume = dw_i2s_resume;
634
635 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
636 /* For devices which use the same registers for playback
637 * and capture, we would set shared flag for registering
638 * the second cpu dai.
639 */
640 if (pdata && pdata->shared) {
641 dev->i2s_base =
> 642 devm_ioremap_shared_resource(&pdev->dev, res);
643 if (IS_ERR(dev->i2s_base))
644 return PTR_ERR(dev->i2s_base);
645 } else {
646 dev->i2s_base =
647 devm_ioremap_resource(&pdev->dev, res);
648 if (IS_ERR(dev->i2s_base))
649 return PTR_ERR(dev->i2s_base);
650 }
651
652 dev->dev = &pdev->dev;
653
654 irq = platform_get_irq(pdev, 0);
655 if (irq >= 0) {
656 ret = devm_request_irq(&pdev->dev, irq, i2s_irq_handler, 0,
657 pdev->name, dev);
658 if (ret < 0) {
659 dev_err(&pdev->dev, "failed to request irq\n");
660 return ret;
661 }
662 }
663
664 dev->i2s_reg_comp1 = I2S_COMP_PARAM_1;
665 dev->i2s_reg_comp2 = I2S_COMP_PARAM_2;
666 if (pdata) {
667 dev->capability = pdata->cap;
668 clk_id = NULL;
669 dev->quirks = pdata->quirks;
670 if (dev->quirks & DW_I2S_QUIRK_COMP_REG_OFFSET) {
671 dev->i2s_reg_comp1 = pdata->i2s_reg_comp1;
672 dev->i2s_reg_comp2 = pdata->i2s_reg_comp2;
673 }
674 ret = dw_configure_dai_by_pd(dev, dw_i2s_dai, res, pdata);
675 } else {
676 clk_id = "i2sclk";
677 ret = dw_configure_dai_by_dt(dev, dw_i2s_dai, res);
678 }
679 if (ret < 0)
680 return ret;
681
682 if (dev->capability & DW_I2S_MASTER) {
683 if (pdata) {
684 dev->i2s_clk_cfg = pdata->i2s_clk_cfg;
685 if (!dev->i2s_clk_cfg) {
686 dev_err(&pdev->dev, "no clock configure method\n");
687 return -ENODEV;
688 }
689 }
690 dev->clk = devm_clk_get(&pdev->dev, clk_id);
691
692 if (IS_ERR(dev->clk))
693 return PTR_ERR(dev->clk);
694
695 ret = clk_prepare_enable(dev->clk);
696 if (ret < 0)
697 return ret;
698 }
699
700 dev_set_drvdata(&pdev->dev, dev);
701 ret = devm_snd_soc_register_component(&pdev->dev, &dw_i2s_component,
702 dw_i2s_dai, 1);
703 if (ret != 0) {
704 dev_err(&pdev->dev, "not able to register dai\n");
705 goto err_clk_disable;
706 }
707
708 if (!pdata) {
709 if (irq >= 0) {
710 ret = dw_pcm_register(pdev);
711 dev->use_pio = true;
712 } else {
713 ret = devm_snd_dmaengine_pcm_register(&pdev->dev, NULL,
714 0);
715 dev->use_pio = false;
716 }
717
718 if (ret) {
719 dev_err(&pdev->dev, "could not register pcm: %d\n",
720 ret);
721 goto err_clk_disable;
722 }
723 }
724
725 pm_runtime_enable(&pdev->dev);
726 return 0;
727
728 err_clk_disable:
729 if (dev->capability & DW_I2S_MASTER)
730 clk_disable_unprepare(dev->clk);
731 return ret;
732 }
733
---
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: 29388 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20180218/7c70bf62/attachment-0001.bin>
More information about the Alsa-devel
mailing list