diff mbox series

PCI: Fix CONFIG_PCI_DYNAMIC_OF_NODES kconfig dependencies

Message ID 1693505947-29786-1-git-send-email-lizhi.hou@amd.com (mailing list archive)
State Accepted
Commit 26641b3f22abe3f03bd8e078c116cc98de740f43
Delegated to: Bjorn Helgaas
Headers show
Series PCI: Fix CONFIG_PCI_DYNAMIC_OF_NODES kconfig dependencies | expand

Commit Message

Lizhi Hou Aug. 31, 2023, 6:19 p.m. UTC
Generating interrupt-map property depends on of_irq_parse_raw() which
is enabled by CONFIG_OF_IRQ. Change CONFIG_PCI_DYNAMIC_OF_NODES
dependency from CONFIG_OF to CONFIG_OF_IRQ.

Reported-by: Guenter Roeck <groeck7@gmail.com>
Closes: https://lore.kernel.org/linux-devicetree/2187619d-55bc-41bb-bbb4-6059399db997@roeck-us.net/
Fixes: 407d1a51921e ("PCI: Create device tree node for bridge")
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
---
 drivers/pci/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Bjorn Helgaas Sept. 5, 2023, 6:13 p.m. UTC | #1
On Thu, Aug 31, 2023 at 11:19:07AM -0700, Lizhi Hou wrote:
> Generating interrupt-map property depends on of_irq_parse_raw() which
> is enabled by CONFIG_OF_IRQ. Change CONFIG_PCI_DYNAMIC_OF_NODES
> dependency from CONFIG_OF to CONFIG_OF_IRQ.

Most of include/linux/of_irq.h is under #ifdef CONFIG_OF_IRQ, with
stubs for the non-CONFIG_OF_IRQ case, with of_irq_parse_raw() being
one of a few exceptions.

In the PCI_DYNAMIC_OF_NODES case, I think we probably want the Kconfig
change in this patch because adding a stub would avoid the build error
but the PCI_DYNAMIC_OF_NODES functionality wouldn't work.

I dunno about the other uses of of_irq_parse_raw().
arch/powerpc/platforms/fsl_uli1575.c also uses it but has no obvious
CONFIG_OF dependency.

drivers/bcma/main.c uses it, but the call is under a CONFIG_OF_IRQ
guard, and I guess the dead code gets eliminated when building without
CONFIG_OF.

> Reported-by: Guenter Roeck <groeck7@gmail.com>
> Closes: https://lore.kernel.org/linux-devicetree/2187619d-55bc-41bb-bbb4-6059399db997@roeck-us.net/
> Fixes: 407d1a51921e ("PCI: Create device tree node for bridge")
> Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>

Applied to for-linus for v6.6-rc1.  Rob, let me know if you want it.

> ---
>  drivers/pci/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig
> index 49bd09c7dd0a..e9ae66cc4189 100644
> --- a/drivers/pci/Kconfig
> +++ b/drivers/pci/Kconfig
> @@ -196,7 +196,7 @@ config PCI_HYPERV
>  
>  config PCI_DYNAMIC_OF_NODES
>  	bool "Create Device tree nodes for PCI devices"
> -	depends on OF
> +	depends on OF_IRQ
>  	select OF_DYNAMIC
>  	help
>  	  This option enables support for generating device tree nodes for some
> -- 
> 2.34.1
>
diff mbox series

Patch

diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig
index 49bd09c7dd0a..e9ae66cc4189 100644
--- a/drivers/pci/Kconfig
+++ b/drivers/pci/Kconfig
@@ -196,7 +196,7 @@  config PCI_HYPERV
 
 config PCI_DYNAMIC_OF_NODES
 	bool "Create Device tree nodes for PCI devices"
-	depends on OF
+	depends on OF_IRQ
 	select OF_DYNAMIC
 	help
 	  This option enables support for generating device tree nodes for some