Re: [PATCH v3] mmc: add new Alcor Micro Cardreader driver

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

 



Hi Oleksij,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on char-misc/char-misc-testing]
[also build test ERROR on v4.19-rc7 next-20181008]
[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/Oleksij-Rempel/mmc-add-new-Alcor-Micro-Cardreader-driver/20181008-154348
config: sh-allmodconfig (attached as .config)
compiler: sh4-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.2.0 make.cross ARCH=sh 

All error/warnings (new ones prefixed by >>):

   drivers/misc/cardreader/alcor_pci.c: In function 'alcor_pci_probe':
>> drivers/misc/cardreader/alcor_pci.c:248:8: error: implicit declaration of function 'pcim_enable_device'; did you mean 'pci_enable_device'? [-Werror=implicit-function-declaration]
     ret = pcim_enable_device(pdev);
           ^~~~~~~~~~~~~~~~~~
           pci_enable_device
   drivers/misc/cardreader/alcor_pci.c: At top level:
>> drivers/misc/cardreader/alcor_pci.c:373:1: warning: data definition has no type or storage class
    module_pci_driver(alcor_driver);
    ^~~~~~~~~~~~~~~~~
>> drivers/misc/cardreader/alcor_pci.c:373:1: error: type defaults to 'int' in declaration of 'module_pci_driver' [-Werror=implicit-int]
>> drivers/misc/cardreader/alcor_pci.c:373:1: warning: parameter names (without types) in function declaration
   drivers/misc/cardreader/alcor_pci.c:363:26: warning: 'alcor_driver' defined but not used [-Wunused-variable]
    static struct pci_driver alcor_driver = {
                             ^~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +248 drivers/misc/cardreader/alcor_pci.c

   238	
   239	static int alcor_pci_probe(struct pci_dev *pdev,
   240				   const struct pci_device_id *ent)
   241	{
   242		struct alcor_dev_cfg *cfg;
   243		struct alcor_pci_priv *priv;
   244		int ret, i, bar = 0;
   245	
   246		cfg = (void *)ent->driver_data;
   247	
 > 248		ret = pcim_enable_device(pdev);
   249		if (ret)
   250			return ret;
   251	
   252		priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
   253		if (!priv)
   254			return -ENOMEM;
   255	
   256		idr_preload(GFP_KERNEL);
   257		spin_lock(&alcor_pci_lock);
   258		ret = idr_alloc(&alcor_pci_idr, priv, 0, 0, GFP_NOWAIT);
   259		if (ret >= 0)
   260			priv->id = ret;
   261		spin_unlock(&alcor_pci_lock);
   262		idr_preload_end();
   263		if (ret < 0)
   264			return ret;
   265	
   266		priv->pdev = pdev;
   267		priv->parent_pdev = pdev->bus->self;
   268		priv->dev = &pdev->dev;
   269		priv->cfg = cfg;
   270		priv->irq = pdev->irq;
   271	
   272		ret = pci_request_regions(pdev, DRV_NAME_ALCOR_PCI);
   273		if (ret) {
   274			dev_err(&pdev->dev, "Cannot request region\n");
   275			return -ENOMEM;
   276		}
   277	
   278		if (!(pci_resource_flags(pdev, bar) & IORESOURCE_MEM)) {
   279			dev_err(&pdev->dev, "BAR %d is not iomem. Aborting.\n", bar);
   280			ret = -ENODEV;
   281			goto error_release_regions;
   282		}
   283	
   284		priv->iobase = pcim_iomap(pdev, bar, 0);
   285		if (!priv->iobase) {
   286			ret = -ENOMEM;
   287			goto error_release_regions;
   288		}
   289	
   290		/* make sure irqs are disabled */
   291		alcor_write32(priv, 0, AU6601_REG_INT_ENABLE);
   292		alcor_write32(priv, 0, AU6601_MS_INT_ENABLE);
   293	
   294		ret = dma_set_mask_and_coherent(priv->dev, AU6601_SDMA_MASK);
   295		if (ret) {
   296			dev_err(priv->dev, "Failed to set DMA mask\n");
   297			goto error_release_regions;
   298		}
   299	
   300		pci_set_master(pdev);
   301		pci_set_drvdata(pdev, priv);
   302		alcor_pci_init_check_aspm(priv);
   303	
   304		for (i = 0; i < ARRAY_SIZE(alcor_pci_cells); i++) {
   305			alcor_pci_cells[i].platform_data = priv;
   306			alcor_pci_cells[i].pdata_size = sizeof(*priv);
   307		}
   308		ret = mfd_add_devices(&pdev->dev, priv->id, alcor_pci_cells,
   309				ARRAY_SIZE(alcor_pci_cells), NULL, 0, NULL);
   310		if (ret < 0)
   311			goto error_release_regions;
   312	
   313		alcor_pci_aspm_ctrl(priv, 0);
   314	
   315		return 0;
   316	
   317	error_release_regions:
   318		pci_release_regions(pdev);
   319		return ret;
   320	}
   321	
   322	static void alcor_pci_remove(struct pci_dev *pdev)
   323	{
   324		struct alcor_pci_priv *priv;
   325	
   326		priv = pci_get_drvdata(pdev);
   327	
   328		alcor_pci_aspm_ctrl(priv, 1);
   329	
   330		mfd_remove_devices(&pdev->dev);
   331	
   332		spin_lock(&alcor_pci_lock);
   333		idr_remove(&alcor_pci_idr, priv->id);
   334		spin_unlock(&alcor_pci_lock);
   335	
   336		pci_release_regions(pdev);
   337		pci_set_drvdata(pdev, NULL);
   338	}
   339	
   340	#ifdef CONFIG_PM_SLEEP
   341	static int alcor_suspend(struct device *dev)
   342	{
   343		struct pci_dev *pdev = to_pci_dev(dev);
   344		struct alcor_pci_priv *priv = pci_get_drvdata(pdev);
   345	
   346		alcor_pci_aspm_ctrl(priv, 1);
   347		return 0;
   348	}
   349	
   350	static int alcor_resume(struct device *dev)
   351	{
   352	
   353		struct pci_dev *pdev = to_pci_dev(dev);
   354		struct alcor_pci_priv *priv = pci_get_drvdata(pdev);
   355	
   356		alcor_pci_aspm_ctrl(priv, 0);
   357		return 0;
   358	}
   359	#endif /* CONFIG_PM_SLEEP */
   360	
   361	static SIMPLE_DEV_PM_OPS(alcor_pm_ops, alcor_suspend, alcor_resume);
   362	
   363	static struct pci_driver alcor_driver = {
   364		.name	=	DRV_NAME_ALCOR_PCI,
   365		.id_table =	pci_ids,
   366		.probe	=	alcor_pci_probe,
   367		.remove =	alcor_pci_remove,
   368		.driver	=	{
   369			.pm	= &alcor_pm_ops
   370		},
   371	};
   372	
 > 373	module_pci_driver(alcor_driver);
   374	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Memonry Technology]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux