Commit 1ba54782 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Marc Zyngier

irqchip: Fix compile-testing without CONFIG_OF

Drivers using the new IRQCHIP_PLATFORM_DRIVER_BEGIN helper
fail to link when compile-testing without CONFIG_OF,
as that means CONFIG_IRQCHIP is disabled as well:

ld.lld: error: undefined symbol: platform_irqchip_probe
>>> referenced by irq-meson-gpio.c
>>>               irqchip/irq-meson-gpio.o:(meson_gpio_intc_driver) in archive drivers/built-in.a
>>> referenced by irq-mchp-eic.c
>>>               irqchip/irq-mchp-eic.o:(mchp_eic_driver) in archive drivers/built-in.a

As the drivers are not actually used in this case, just
making the reference to this symbol conditional helps
avoid the link failure.

Fixes: f8410e62 ("irqchip: Add IRQCHIP_PLATFORM_DRIVER_BEGIN/END and IRQCHIP_MATCH helper macros")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211022154927.920491-1-arnd@kernel.org
parent 21ce6992
...@@ -39,8 +39,9 @@ static const struct of_device_id drv_name##_irqchip_match_table[] = { ...@@ -39,8 +39,9 @@ static const struct of_device_id drv_name##_irqchip_match_table[] = {
{}, \ {}, \
}; \ }; \
MODULE_DEVICE_TABLE(of, drv_name##_irqchip_match_table); \ MODULE_DEVICE_TABLE(of, drv_name##_irqchip_match_table); \
static struct platform_driver drv_name##_driver = { \ static struct platform_driver drv_name##_driver = { \
.probe = platform_irqchip_probe, \ .probe = IS_ENABLED(CONFIG_IRQCHIP) ? \
platform_irqchip_probe : NULL, \
.driver = { \ .driver = { \
.name = #drv_name, \ .name = #drv_name, \
.owner = THIS_MODULE, \ .owner = THIS_MODULE, \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment