All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] irqchip: fix compile-testing without CONFIG_OF
@ 2021-10-22 15:49 Arnd Bergmann
  2021-10-22 19:12 ` Florian Fainelli
  2021-10-25  8:11 ` [irqchip: irq/irqchip-next] irqchip: Fix " irqchip-bot for Arnd Bergmann
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2021-10-22 15:49 UTC (permalink / raw)
  To: Saravana Kannan, Marc Zyngier
  Cc: Arnd Bergmann, Florian Fainelli, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

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: f8410e626569 ("irqchip: Add IRQCHIP_PLATFORM_DRIVER_BEGIN/END and IRQCHIP_MATCH helper macros")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 include/linux/irqchip.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/linux/irqchip.h b/include/linux/irqchip.h
index 7f007b9c23f8..3a091d0710ae 100644
--- a/include/linux/irqchip.h
+++ b/include/linux/irqchip.h
@@ -48,8 +48,9 @@ static const struct of_device_id drv_name##_irqchip_match_table[] = {
 	{},								\
 };									\
 MODULE_DEVICE_TABLE(of, drv_name##_irqchip_match_table);		\
-static struct platform_driver drv_name##_driver = {		\
-	.probe  = platform_irqchip_probe,				\
+static struct platform_driver drv_name##_driver = {			\
+	.probe  = IS_ENABLED(CONFIG_IRQCHIP) ? 				\
+			platform_irqchip_probe : NULL,			\
 	.driver = {							\
 		.name = #drv_name,					\
 		.owner = THIS_MODULE,					\
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] irqchip: fix compile-testing without CONFIG_OF
  2021-10-22 15:49 [PATCH] irqchip: fix compile-testing without CONFIG_OF Arnd Bergmann
@ 2021-10-22 19:12 ` Florian Fainelli
  2021-10-25  8:11 ` [irqchip: irq/irqchip-next] irqchip: Fix " irqchip-bot for Arnd Bergmann
  1 sibling, 0 replies; 3+ messages in thread
From: Florian Fainelli @ 2021-10-22 19:12 UTC (permalink / raw)
  To: Arnd Bergmann, Saravana Kannan, Marc Zyngier; +Cc: Arnd Bergmann, linux-kernel

On 10/22/21 8:49 AM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> 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: f8410e626569 ("irqchip: Add IRQCHIP_PLATFORM_DRIVER_BEGIN/END and IRQCHIP_MATCH helper macros")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [irqchip: irq/irqchip-next] irqchip: Fix compile-testing without CONFIG_OF
  2021-10-22 15:49 [PATCH] irqchip: fix compile-testing without CONFIG_OF Arnd Bergmann
  2021-10-22 19:12 ` Florian Fainelli
@ 2021-10-25  8:11 ` irqchip-bot for Arnd Bergmann
  1 sibling, 0 replies; 3+ messages in thread
From: irqchip-bot for Arnd Bergmann @ 2021-10-25  8:11 UTC (permalink / raw)
  To: linux-kernel; +Cc: Arnd Bergmann, Florian Fainelli, Marc Zyngier, tglx

The following commit has been merged into the irq/irqchip-next branch of irqchip:

Commit-ID:     1ba5478270a5c3a02b08052a3c003c282f2db94a
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/1ba5478270a5c3a02b08052a3c003c282f2db94a
Author:        Arnd Bergmann <arnd@arndb.de>
AuthorDate:    Fri, 22 Oct 2021 17:49:21 +02:00
Committer:     Marc Zyngier <maz@kernel.org>
CommitterDate: Mon, 25 Oct 2021 08:55:42 +01:00

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: f8410e626569 ("irqchip: Add IRQCHIP_PLATFORM_DRIVER_BEGIN/END and IRQCHIP_MATCH helper macros")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211022154927.920491-1-arnd@kernel.org
---
 include/linux/irqchip.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/linux/irqchip.h b/include/linux/irqchip.h
index 67351aa..29dbe67 100644
--- a/include/linux/irqchip.h
+++ b/include/linux/irqchip.h
@@ -39,8 +39,9 @@ static const struct of_device_id drv_name##_irqchip_match_table[] = {
 	{},								\
 };									\
 MODULE_DEVICE_TABLE(of, drv_name##_irqchip_match_table);		\
-static struct platform_driver drv_name##_driver = {		\
-	.probe  = platform_irqchip_probe,				\
+static struct platform_driver drv_name##_driver = {			\
+	.probe  = IS_ENABLED(CONFIG_IRQCHIP) ? 				\
+			platform_irqchip_probe : NULL,			\
 	.driver = {							\
 		.name = #drv_name,					\
 		.owner = THIS_MODULE,					\

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-25  8:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-22 15:49 [PATCH] irqchip: fix compile-testing without CONFIG_OF Arnd Bergmann
2021-10-22 19:12 ` Florian Fainelli
2021-10-25  8:11 ` [irqchip: irq/irqchip-next] irqchip: Fix " irqchip-bot for Arnd Bergmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.