Re: [PATCH 1/2] i2c: aspeed: added driver for Aspeed I2C

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

 



Hi Brendan,

[auto build test ERROR on wsa/i2c/for-next]
[also build test ERROR on v4.8-rc5 next-20160909]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
[Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
[Check https://git-scm.com/docs/git-format-patch for more information]

url:    https://github.com/0day-ci/linux/commits/Brendan-Higgins/i2c-aspeed-added-driver-for-Aspeed-I2C/20160910-035912
base:   https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/for-next
config: x86_64-allmodconfig (attached as .config)
compiler: gcc-6 (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

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

   In file included from drivers/i2c/busses/i2c-aspeed.c:14:0:
>> drivers/i2c/busses/i2c-aspeed.c:697:25: error: 'aspeed_i2c_of_table' undeclared here (not in a function)
    MODULE_DEVICE_TABLE(of, aspeed_i2c_of_table);
                            ^
   include/linux/module.h:213:21: note: in definition of macro 'MODULE_DEVICE_TABLE'
    extern const typeof(name) __mod_##type##__##name##_device_table  \
                        ^~~~
>> include/linux/module.h:130:27: error: redefinition of '__inittest'
     static inline initcall_t __inittest(void)  \
                              ^
   include/linux/device.h:1350:1: note: in expansion of macro 'module_init'
    module_init(__driver##_init); \
    ^~~~~~~~~~~
>> include/linux/platform_device.h:228:2: note: in expansion of macro 'module_driver'
     module_driver(__platform_driver, platform_driver_register, \
     ^~~~~~~~~~~~~
>> drivers/i2c/busses/i2c-aspeed.c:812:1: note: in expansion of macro 'module_platform_driver'
    module_platform_driver(aspeed_i2c_controller_driver);
    ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/module.h:130:27: note: previous definition of '__inittest' was here
     static inline initcall_t __inittest(void)  \
                              ^
   include/linux/device.h:1350:1: note: in expansion of macro 'module_init'
    module_init(__driver##_init); \
    ^~~~~~~~~~~
>> include/linux/platform_device.h:228:2: note: in expansion of macro 'module_driver'
     module_driver(__platform_driver, platform_driver_register, \
     ^~~~~~~~~~~~~
   drivers/i2c/busses/i2c-aspeed.c:707:1: note: in expansion of macro 'module_platform_driver'
    module_platform_driver(aspeed_i2c_bus_driver);
    ^~~~~~~~~~~~~~~~~~~~~~
>> include/linux/module.h:132:6: error: redefinition of 'init_module'
     int init_module(void) __attribute__((alias(#initfn)));
         ^
   include/linux/device.h:1350:1: note: in expansion of macro 'module_init'
    module_init(__driver##_init); \
    ^~~~~~~~~~~
>> include/linux/platform_device.h:228:2: note: in expansion of macro 'module_driver'
     module_driver(__platform_driver, platform_driver_register, \
     ^~~~~~~~~~~~~
>> drivers/i2c/busses/i2c-aspeed.c:812:1: note: in expansion of macro 'module_platform_driver'
    module_platform_driver(aspeed_i2c_controller_driver);
    ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/module.h:132:6: note: previous definition of 'init_module' was here
     int init_module(void) __attribute__((alias(#initfn)));
         ^
   include/linux/device.h:1350:1: note: in expansion of macro 'module_init'
    module_init(__driver##_init); \
    ^~~~~~~~~~~
>> include/linux/platform_device.h:228:2: note: in expansion of macro 'module_driver'
     module_driver(__platform_driver, platform_driver_register, \
     ^~~~~~~~~~~~~
   drivers/i2c/busses/i2c-aspeed.c:707:1: note: in expansion of macro 'module_platform_driver'
    module_platform_driver(aspeed_i2c_bus_driver);
    ^~~~~~~~~~~~~~~~~~~~~~
>> include/linux/module.h:136:27: error: redefinition of '__exittest'
     static inline exitcall_t __exittest(void)  \
                              ^
   include/linux/device.h:1355:1: note: in expansion of macro 'module_exit'
    module_exit(__driver##_exit);
    ^~~~~~~~~~~
>> include/linux/platform_device.h:228:2: note: in expansion of macro 'module_driver'
     module_driver(__platform_driver, platform_driver_register, \
     ^~~~~~~~~~~~~
>> drivers/i2c/busses/i2c-aspeed.c:812:1: note: in expansion of macro 'module_platform_driver'
    module_platform_driver(aspeed_i2c_controller_driver);
    ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/module.h:136:27: note: previous definition of '__exittest' was here
     static inline exitcall_t __exittest(void)  \
                              ^
   include/linux/device.h:1355:1: note: in expansion of macro 'module_exit'
    module_exit(__driver##_exit);
    ^~~~~~~~~~~
>> include/linux/platform_device.h:228:2: note: in expansion of macro 'module_driver'
     module_driver(__platform_driver, platform_driver_register, \
     ^~~~~~~~~~~~~
   drivers/i2c/busses/i2c-aspeed.c:707:1: note: in expansion of macro 'module_platform_driver'
    module_platform_driver(aspeed_i2c_bus_driver);
    ^~~~~~~~~~~~~~~~~~~~~~
>> include/linux/module.h:138:7: error: redefinition of 'cleanup_module'
     void cleanup_module(void) __attribute__((alias(#exitfn)));
          ^
   include/linux/device.h:1355:1: note: in expansion of macro 'module_exit'
    module_exit(__driver##_exit);
    ^~~~~~~~~~~
>> include/linux/platform_device.h:228:2: note: in expansion of macro 'module_driver'
     module_driver(__platform_driver, platform_driver_register, \
     ^~~~~~~~~~~~~
>> drivers/i2c/busses/i2c-aspeed.c:812:1: note: in expansion of macro 'module_platform_driver'
    module_platform_driver(aspeed_i2c_controller_driver);
    ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/module.h:138:7: note: previous definition of 'cleanup_module' was here
     void cleanup_module(void) __attribute__((alias(#exitfn)));
          ^
   include/linux/device.h:1355:1: note: in expansion of macro 'module_exit'
    module_exit(__driver##_exit);
    ^~~~~~~~~~~
>> include/linux/platform_device.h:228:2: note: in expansion of macro 'module_driver'
     module_driver(__platform_driver, platform_driver_register, \
     ^~~~~~~~~~~~~
   drivers/i2c/busses/i2c-aspeed.c:707:1: note: in expansion of macro 'module_platform_driver'
    module_platform_driver(aspeed_i2c_bus_driver);
    ^~~~~~~~~~~~~~~~~~~~~~
>> include/linux/module.h:213:27: error: '__mod_of__aspeed_i2c_of_table_device_table' aliased to undefined symbol 'aspeed_i2c_of_table'
    extern const typeof(name) __mod_##type##__##name##_device_table  \
                              ^
>> drivers/i2c/busses/i2c-aspeed.c:801:1: note: in expansion of macro 'MODULE_DEVICE_TABLE'
    MODULE_DEVICE_TABLE(of, aspeed_i2c_of_table);
    ^~~~~~~~~~~~~~~~~~~
>> include/linux/module.h:213:27: error: '__mod_of__aspeed_i2c_of_table_device_table' aliased to undefined symbol 'aspeed_i2c_of_table'
    extern const typeof(name) __mod_##type##__##name##_device_table  \
                              ^

vim +/aspeed_i2c_of_table +697 drivers/i2c/busses/i2c-aspeed.c

   691	
   692	static const struct of_device_id aspeed_i2c_bus_of_table[] = {
   693		{ .compatible = "aspeed,ast2400-i2c-bus", },
   694		{ .compatible = "aspeed,ast2500-i2c-bus", },
   695		{ },
   696	};
 > 697	MODULE_DEVICE_TABLE(of, aspeed_i2c_of_table);
   698	
   699	static struct platform_driver aspeed_i2c_bus_driver = {
   700		.probe		= aspeed_i2c_probe_bus,
   701		.remove		= aspeed_i2c_remove_bus,
   702		.driver         = {
   703			.name   = "ast-i2c-bus",
   704			.of_match_table = aspeed_i2c_bus_of_table,
   705		},
   706	};
 > 707	module_platform_driver(aspeed_i2c_bus_driver);
   708	
   709	static void aspeed_i2c_controller_irq(struct irq_desc *desc)
   710	{
   711		struct aspeed_i2c_controller *c = irq_desc_get_handler_data(desc);
   712		unsigned long p, status;
   713		unsigned int bus_irq;
   714	
   715		status = readl(c->base);
   716		for_each_set_bit(p, &status, ASPEED_I2C_NUM_BUS) {
   717			bus_irq = irq_find_mapping(c->irq_domain, p);
   718			generic_handle_irq(bus_irq);
   719		}
   720	}
   721	
   722	static int aspeed_i2c_probe_controller(struct platform_device *pdev)
   723	{
   724		struct aspeed_i2c_controller *controller;
   725		struct device_node *np;
   726		struct resource *res;
   727	
   728		controller = kzalloc(sizeof(*controller), GFP_KERNEL);
   729		if (!controller)
   730			return -ENOMEM;
   731	
   732		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   733		controller->base = devm_ioremap_resource(&pdev->dev, res);
   734		if (IS_ERR(controller->base))
   735			return PTR_ERR(controller->base);
   736	
   737		controller->irq = platform_get_irq(pdev, 0);
   738		if (controller->irq < 0) {
   739			dev_err(&pdev->dev, "no platform IRQ\n");
   740			return -ENXIO;
   741		}
   742	
   743		controller->irq_domain = irq_domain_add_linear(pdev->dev.of_node,
   744				ASPEED_I2C_NUM_BUS, &irq_domain_simple_ops, NULL);
   745		if (!controller->irq_domain) {
   746			dev_err(&pdev->dev, "no IRQ domain\n");
   747			return -ENXIO;
   748		}
   749		controller->irq_domain->name = "ast-i2c-domain";
   750	
   751		irq_set_chained_handler_and_data(controller->irq,
   752				aspeed_i2c_controller_irq, controller);
   753	
   754		controller->dev = &pdev->dev;
   755	
   756		platform_set_drvdata(pdev, controller);
   757	
   758		dev_info(controller->dev, "i2c controller registered, irq %d\n",
   759				controller->irq);
   760	
   761		for_each_child_of_node(pdev->dev.of_node, np) {
   762			int ret;
   763			u32 bus_num;
   764			char bus_id[sizeof("i2c-12345")];
   765	
   766			/*
   767			 * Set a useful name derived from the bus number; the device
   768			 * tree should provide us with one that corresponds to the
   769			 * hardware numbering.  If the property is missing the
   770			 * probe would fail so just skip it here.
   771			 */
   772	
   773			ret = of_property_read_u32(np, "bus", &bus_num);
   774			if (ret)
   775				continue;
   776	
   777			ret = snprintf(bus_id, sizeof(bus_id), "i2c-%u", bus_num);
   778			if (ret >= sizeof(bus_id))
   779				continue;
   780	
   781			of_platform_device_create(np, bus_id, &pdev->dev);
   782			of_node_put(np);
   783		}
   784	
   785		return 0;
   786	}
   787	
   788	static int aspeed_i2c_remove_controller(struct platform_device *pdev)
   789	{
   790		struct aspeed_i2c_controller *controller = platform_get_drvdata(pdev);
   791	
   792		irq_domain_remove(controller->irq_domain);
   793		return 0;
   794	}
   795	
   796	static const struct of_device_id aspeed_i2c_controller_of_table[] = {
   797		{ .compatible = "aspeed,ast2400-i2c-controller", },
   798		{ .compatible = "aspeed,ast2500-i2c-controller", },
   799		{ },
   800	};
 > 801	MODULE_DEVICE_TABLE(of, aspeed_i2c_of_table);
   802	
   803	static struct platform_driver aspeed_i2c_controller_driver = {
   804		.probe		= aspeed_i2c_probe_controller,
   805		.remove		= aspeed_i2c_remove_controller,
   806		.driver         = {
   807			.name   = "ast-i2c-controller",
   808			.of_match_table = aspeed_i2c_controller_of_table,
   809		},
   810	};
   811	
 > 812	module_platform_driver(aspeed_i2c_controller_driver);
   813	
   814	MODULE_AUTHOR("Brendan Higgins <brendanhiggins@xxxxxxxxxx>");
   815	MODULE_DESCRIPTION("Aspeed I2C Bus Driver");

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

Attachment: .config.gz
Description: Binary data


[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux