Re: [PATCH v2] net: macb: Added PCI wrapper for Platform Driver.
From: kbuild test robot
Date: Mon Dec 12 2016 - 10:01:31 EST
Hi Bartosz,
[auto build test ERROR on net-next/master]
[also build test ERROR on v4.9 next-20161209]
[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/Bartosz-Folta/net-macb-Added-PCI-wrapper-for-Platform-Driver/20161212-220228
config: blackfin-allyesconfig (attached as .config)
compiler: bfin-uclinux-gcc (GCC) 6.2.0
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=blackfin
All error/warnings (new ones prefixed by >>):
drivers/net/ethernet/cadence/macb_pci.c: In function 'macb_probe':
drivers/net/ethernet/cadence/macb_pci.c:78:19: error: implicit declaration of function 'clk_register_fixed_rate' [-Werror=implicit-function-declaration]
plat_data.pclk = clk_register_fixed_rate(&pdev->dev, "pclk", NULL, 0,
^~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/cadence/macb_pci.c:78:17: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
plat_data.pclk = clk_register_fixed_rate(&pdev->dev, "pclk", NULL, 0,
^
drivers/net/ethernet/cadence/macb_pci.c:85:17: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
plat_data.hclk = clk_register_fixed_rate(&pdev->dev, "hclk", NULL, 0,
^
drivers/net/ethernet/cadence/macb_pci.c:116:2: error: implicit declaration of function 'clk_unregister' [-Werror=implicit-function-declaration]
clk_unregister(plat_data.hclk);
^~~~~~~~~~~~~~
drivers/net/ethernet/cadence/macb_pci.c: At top level:
>> drivers/net/ethernet/cadence/macb_pci.c:149:1: warning: data definition has no type or storage class
module_pci_driver(macb_pci_driver);
^~~~~~~~~~~~~~~~~
>> drivers/net/ethernet/cadence/macb_pci.c:149:1: error: type defaults to 'int' in declaration of 'module_pci_driver' [-Werror=implicit-int]
>> drivers/net/ethernet/cadence/macb_pci.c:149:1: warning: parameter names (without types) in function declaration
drivers/net/ethernet/cadence/macb_pci.c:142:26: warning: 'macb_pci_driver' defined but not used [-Wunused-variable]
static struct pci_driver macb_pci_driver = {
^~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +149 drivers/net/ethernet/cadence/macb_pci.c
79 GEM_PCLK_RATE);
80 if (IS_ERR(plat_data.pclk)) {
81 err = PTR_ERR(plat_data.pclk);
82 goto err_pclk_register;
83 }
84
> 85 plat_data.hclk = clk_register_fixed_rate(&pdev->dev, "hclk", NULL, 0,
86 GEM_HCLK_RATE);
87 if (IS_ERR(plat_data.hclk)) {
88 err = PTR_ERR(plat_data.hclk);
89 goto err_hclk_register;
90 }
91
92 /* set up platform device info */
93 memset(&plat_info, 0, sizeof(plat_info));
94 plat_info.parent = &pdev->dev;
95 plat_info.fwnode = pdev->dev.fwnode;
96 plat_info.name = PLAT_DRIVER_NAME;
97 plat_info.id = pdev->devfn;
98 plat_info.res = res;
99 plat_info.num_res = ARRAY_SIZE(res);
100 plat_info.data = &plat_data;
101 plat_info.size_data = sizeof(plat_data);
102 plat_info.dma_mask = DMA_BIT_MASK(32);
103
104 /* register platform device */
105 plat_dev = platform_device_register_full(&plat_info);
106 if (IS_ERR(plat_dev)) {
107 err = PTR_ERR(plat_dev);
108 goto err_plat_dev_register;
109 }
110
111 pci_set_drvdata(pdev, plat_dev);
112
113 return 0;
114
115 err_plat_dev_register:
> 116 clk_unregister(plat_data.hclk);
117
118 err_hclk_register:
119 clk_unregister(plat_data.pclk);
120
121 err_pclk_register:
122 pci_disable_device(pdev);
123 return err;
124 }
125
126 void macb_remove(struct pci_dev *pdev)
127 {
128 struct platform_device *plat_dev = pci_get_drvdata(pdev);
129 struct macb_platform_data *plat_data = dev_get_platdata(&plat_dev->dev);
130
131 platform_device_unregister(plat_dev);
132 pci_disable_device(pdev);
133 clk_unregister(plat_data->pclk);
134 clk_unregister(plat_data->hclk);
135 }
136
137 static struct pci_device_id dev_id_table[] = {
138 { PCI_DEVICE(CDNS_VENDOR_ID, CDNS_DEVICE_ID), },
139 { 0, }
140 };
141
142 static struct pci_driver macb_pci_driver = {
143 .name = PCI_DRIVER_NAME,
144 .id_table = dev_id_table,
145 .probe = macb_probe,
146 .remove = macb_remove,
147 };
148
> 149 module_pci_driver(macb_pci_driver);
150 MODULE_DEVICE_TABLE(pci, dev_id_table);
151 MODULE_LICENSE("GPL");
152 MODULE_DESCRIPTION("Cadence NIC PCI wrapper");
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip