Re: [PATCH v2] ASoC: amd: put off registering mach platform_dev to avoid -517 err

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Hui,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on asoc/for-next]
[also build test WARNING on next-20200522]
[cannot apply to v5.7-rc6]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Hui-Wang/ASoC-amd-put-off-registering-mach-platform_dev-to-avoid-517-err/20200522-162223
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: x86_64-allmodconfig (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-193-gb8fad4bc-dirty
        # save the attached .config to linux build tree
        make W=1 C=1 ARCH=x86_64 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@xxxxxxxxx>


sparse warnings: (new ones prefixed by >>)

>> sound/soc/amd/renoir/acp3x-pdm-dma.c:405:49: sparse: sparse: Using plain integer as NULL pointer

vim +405 sound/soc/amd/renoir/acp3x-pdm-dma.c

   398	
   399	static int acp_pdm_audio_probe(struct platform_device *pdev)
   400	{
   401		struct resource *res;
   402		struct pdm_dev_data *adata;
   403		unsigned int irqflags;
   404		int status;
 > 405		struct platform_device_info pdevinfo = {0};
   406	
   407		if (!pdev->dev.platform_data) {
   408			dev_err(&pdev->dev, "platform_data not retrieved\n");
   409			return -ENODEV;
   410		}
   411		irqflags = *((unsigned int *)(pdev->dev.platform_data));
   412	
   413		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   414		if (!res) {
   415			dev_err(&pdev->dev, "IORESOURCE_MEM FAILED\n");
   416			return -ENODEV;
   417		}
   418	
   419		adata = devm_kzalloc(&pdev->dev, sizeof(*adata), GFP_KERNEL);
   420		if (!adata)
   421			return -ENOMEM;
   422	
   423		adata->acp_base = devm_ioremap(&pdev->dev, res->start,
   424					       resource_size(res));
   425		if (!adata->acp_base)
   426			return -ENOMEM;
   427	
   428		res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
   429		if (!res) {
   430			dev_err(&pdev->dev, "IORESOURCE_IRQ FAILED\n");
   431			return -ENODEV;
   432		}
   433	
   434		adata->pdm_irq = res->start;
   435		adata->capture_stream = NULL;
   436	
   437		dev_set_drvdata(&pdev->dev, adata);
   438		status = devm_snd_soc_register_component(&pdev->dev,
   439							 &acp_pdm_component,
   440							 &acp_pdm_dai_driver, 1);
   441		if (status) {
   442			dev_err(&pdev->dev, "Fail to register acp pdm dai\n");
   443	
   444			return -ENODEV;
   445		}
   446		status = devm_request_irq(&pdev->dev, adata->pdm_irq, pdm_irq_handler,
   447					  irqflags, "ACP_PDM_IRQ", adata);
   448		if (status) {
   449			dev_err(&pdev->dev, "ACP PDM IRQ request failed\n");
   450			return -ENODEV;
   451		}
   452	
   453		pdevinfo.name = "acp_pdm_mach";
   454		pdevinfo.id = 0;
   455		pdevinfo.parent = &pdev->dev;
   456		adata->m_pdev = platform_device_register_full(&pdevinfo);
   457		if (IS_ERR(adata->m_pdev)) {
   458			dev_err(&pdev->dev, "cannot register %s device\n",
   459				pdevinfo.name);
   460			return PTR_ERR(adata->m_pdev);
   461		}
   462		pm_runtime_set_autosuspend_delay(&pdev->dev, ACP_SUSPEND_DELAY_MS);
   463		pm_runtime_use_autosuspend(&pdev->dev);
   464		pm_runtime_enable(&pdev->dev);
   465		pm_runtime_allow(&pdev->dev);
   466		return 0;
   467	}
   468	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux