Skip to content

Commit 1ba5478

Browse files
arndbMarc Zyngier
authored andcommitted
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: f8410e6 ("irqchip: Add IRQCHIP_PLATFORM_DRIVER_BEGIN/END and IRQCHIP_MATCH helper macros") Signed-off-by: Arnd Bergmann <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 21ce699 commit 1ba5478

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

include/linux/irqchip.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ static const struct of_device_id drv_name##_irqchip_match_table[] = {
3939
{}, \
4040
}; \
4141
MODULE_DEVICE_TABLE(of, drv_name##_irqchip_match_table); \
42-
static struct platform_driver drv_name##_driver = { \
43-
.probe = platform_irqchip_probe, \
42+
static struct platform_driver drv_name##_driver = { \
43+
.probe = IS_ENABLED(CONFIG_IRQCHIP) ? \
44+
platform_irqchip_probe : NULL, \
4445
.driver = { \
4546
.name = #drv_name, \
4647
.owner = THIS_MODULE, \

0 commit comments

Comments
 (0)