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

From: kbuild test robot
Date: Fri Sep 09 2016 - 18:49:55 EST


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_d