Re: [PATCH v1] mmc: add new au6601 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 linus/master]
[also build test ERROR on v4.17 next-20180606]
[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-au6601-driver/20180607-162542
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
        make.cross ARCH=sh 

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

   In file included from include/linux/printk.h:332:0,
                    from include/linux/kernel.h:14,
                    from include/linux/delay.h:22,
                    from drivers/mmc/host/au6601.c:9:
   drivers/mmc/host/au6601.c: In function 'au6601_trf_block_pio':
   drivers/mmc/host/au6601.c:728:21: warning: format '%lx' expects argument of type 'long unsigned int', but argument 5 has type 'size_t {aka unsigned int}' [-Wformat=]
     dev_dbg(host->dev, "PIO, %s block size: 0x%lx\n",
                        ^
   include/linux/dynamic_debug.h:135:39: note: in definition of macro 'dynamic_dev_dbg'
      __dynamic_dev_dbg(&descriptor, dev, fmt, \
                                          ^~~
   drivers/mmc/host/au6601.c:728:2: note: in expansion of macro 'dev_dbg'
     dev_dbg(host->dev, "PIO, %s block size: 0x%lx\n",
     ^~~~~~~
   drivers/mmc/host/au6601.c: In function 'au6601_pci_probe':
>> drivers/mmc/host/au6601.c:1589: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/mmc/host/au6601.c: At top level:
>> drivers/mmc/host/au6601.c:1740:1: warning: data definition has no type or storage class
    module_pci_driver(au6601_driver);
    ^~~~~~~~~~~~~~~~~
>> drivers/mmc/host/au6601.c:1740:1: error: type defaults to 'int' in declaration of 'module_pci_driver' [-Werror=implicit-int]
>> drivers/mmc/host/au6601.c:1740:1: warning: parameter names (without types) in function declaration
   drivers/mmc/host/au6601.c:1730:26: warning: 'au6601_driver' defined but not used [-Wunused-variable]
    static struct pci_driver au6601_driver = {
                             ^~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +1589 drivers/mmc/host/au6601.c

  1576	
  1577	static int au6601_pci_probe(struct pci_dev *pdev,
  1578				   const struct pci_device_id *ent)
  1579	{
  1580		struct au6601_dev_cfg *cfg;
  1581		struct mmc_host *mmc;
  1582		struct au6601_host *host;
  1583		int ret, bar = 0;
  1584	
  1585		dev_info(&pdev->dev, "AU6601 controller found [%04x:%04x] (rev %x)\n",
  1586			 (int)pdev->vendor, (int)pdev->device, (int)pdev->revision);
  1587		cfg = (void *)ent->driver_data;
  1588	
> 1589		ret = pcim_enable_device(pdev);
  1590		if (ret)
  1591			return ret;
  1592	
  1593		mmc = mmc_alloc_host(sizeof(struct au6601_host *), &pdev->dev);
  1594		if (!mmc) {
  1595			dev_err(&pdev->dev, "Can't allocate MMC\n");
  1596			return -ENOMEM;
  1597		}
  1598	
  1599		host = mmc_priv(mmc);
  1600		host->mmc = mmc;
  1601		host->pdev = pdev;
  1602		host->parent_pdev = pdev->bus->self;
  1603		host->dev = &pdev->dev;
  1604		host->cfg = cfg;
  1605		host->cur_power_mode = MMC_POWER_UNDEFINED;
  1606		host->use_dma = use_dma;
  1607	
  1608		ret = pci_request_regions(pdev, DRVNAME);
  1609		if (ret) {
  1610			dev_err(&pdev->dev, "Cannot request region\n");
  1611			return -ENOMEM;
  1612		}
  1613	
  1614		if (!(pci_resource_flags(pdev, bar) & IORESOURCE_MEM)) {
  1615			dev_err(&pdev->dev, "BAR %d is not iomem. Aborting.\n", bar);
  1616			ret = -ENODEV;
  1617			goto error_release_regions;
  1618		}
  1619	
  1620		host->iobase = pcim_iomap(pdev, bar, 0);
  1621		if (!host->iobase) {
  1622			ret = -ENOMEM;
  1623			goto error_release_regions;
  1624		}
  1625	
  1626		/* make sure irqs are disabled */
  1627		au6601_mask_sd_irqs(host);
  1628		au6601_mask_ms_irqs(host);
  1629	
  1630		ret = devm_request_threaded_irq(&pdev->dev, pdev->irq,
  1631				au6601_irq, au6601_irq_thread, IRQF_SHARED,
  1632						"au6601", host);
  1633	
  1634		if (ret) {
  1635			dev_err(&pdev->dev, "Failed to get irq for data line\n");
  1636			ret = -ENOMEM;
  1637			goto error_release_regions;
  1638		}
  1639	
  1640		ret = dma_set_mask_and_coherent(host->dev, AU6601_SDMA_MASK);
  1641		if (ret) {
  1642			dev_err(host->dev, "Failed to set DMA mask\n");
  1643			goto error_release_regions;
  1644		}
  1645	
  1646		pci_set_master(pdev);
  1647		pci_set_drvdata(pdev, host);
  1648		pci_init_check_aspm(host);
  1649	
  1650		spin_lock_init(&host->lock);
  1651		mutex_init(&host->cmd_mutex);
  1652		/*
  1653		 * Init tasklets.
  1654		 */
  1655		INIT_DELAYED_WORK(&host->timeout_work, au6601_timeout_timer);
  1656	
  1657		au6601_init_mmc(host);
  1658		au6601_hw_init(host);
  1659	
  1660		mmc_add_host(mmc);
  1661		return 0;
  1662	
  1663	error_release_regions:
  1664		pci_release_regions(pdev);
  1665		return ret;
  1666	}
  1667	
  1668	static void au6601_hw_uninit(struct au6601_host *host)
  1669	{
  1670		au6601_mask_sd_irqs(host);
  1671		au6601_mask_ms_irqs(host);
  1672	
  1673		au6601_reset(host, AU6601_RESET_CMD | AU6601_RESET_DATA);
  1674	
  1675		au6601_write8(host, 0, AU6601_DETECT_STATUS);
  1676	
  1677		au6601_write8(host, 0, AU6601_OUTPUT_ENABLE);
  1678		au6601_write8(host, 0, AU6601_POWER_CONTROL);
  1679	
  1680		au6601_write8(host, 0, AU6601_OPT);
  1681		pci_aspm_ctrl(host, 1);
  1682	}
  1683	
  1684	static void au6601_pci_remove(struct pci_dev *pdev)
  1685	{
  1686		struct au6601_host *host;
  1687	
  1688		host = pci_get_drvdata(pdev);
  1689	
  1690		if (cancel_delayed_work_sync(&host->timeout_work))
  1691			au6601_request_complete(host, 0);
  1692	
  1693		mmc_remove_host(host->mmc);
  1694	
  1695		au6601_hw_uninit(host);
  1696	
  1697		mmc_free_host(host->mmc);
  1698	
  1699		pci_release_regions(pdev);
  1700		pci_set_drvdata(pdev, NULL);
  1701	}
  1702	
  1703	#ifdef CONFIG_PM_SLEEP
  1704	static int au6601_suspend(struct device *dev)
  1705	{
  1706		struct pci_dev *pdev = to_pci_dev(dev);
  1707		struct au6601_host *host = pci_get_drvdata(pdev);
  1708	
  1709		cancel_delayed_work_sync(&host->timeout_work);
  1710		flush_delayed_work(&host->timeout_work);
  1711		au6601_hw_uninit(host);
  1712		return 0;
  1713	}
  1714	
  1715	static int au6601_resume(struct device *dev)
  1716	{
  1717	
  1718		struct pci_dev *pdev = to_pci_dev(dev);
  1719		struct au6601_host *host = pci_get_drvdata(pdev);
  1720	
  1721		mutex_lock(&host->cmd_mutex);
  1722		au6601_hw_init(host);
  1723		mutex_unlock(&host->cmd_mutex);
  1724		return 0;
  1725	}
  1726	#endif /* CONFIG_PM_SLEEP */
  1727	
  1728	static SIMPLE_DEV_PM_OPS(au6601_pm_ops, au6601_suspend, au6601_resume);
  1729	
  1730	static struct pci_driver au6601_driver = {
  1731		.name	=	DRVNAME,
  1732		.id_table =	pci_ids,
  1733		.probe	=	au6601_pci_probe,
  1734		.remove =	au6601_pci_remove,
  1735		.driver	=	{
  1736			.pm	= &au6601_pm_ops
  1737		},
  1738	};
  1739	
> 1740	module_pci_driver(au6601_driver);
  1741	

---
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 USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux