Skip to content

Commit 5a7319b

Browse files
committed
of: unittest: Fix of_unittest_pci_node() kconfig dependencies
of_unittest_pci_node test depends on both CONFIG_PCI_DYNAMIC_OF_NODES and CONFIG_OF_OVERLAY. Move the test into the existing CONFIG_OF_OVERLAY ifdef and rework the CONFIG_PCI_DYNAMIC_OF_NODES dependency to use IS_ENABLED() instead. This reduces the combinations to build. Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Fixes: 26409dd ("of: unittest: Add pci_dt_testdrv pci driver") Cc: Lizhi Hou <[email protected]> Acked-by: Randy Dunlap <[email protected]> Tested-by: Randy Dunlap <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Rob Herring <[email protected]>
1 parent 911325d commit 5a7319b

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

drivers/of/unittest.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3799,14 +3799,6 @@ static __init void of_unittest_overlay_high_level(void)
37993799
mutex_unlock(&of_mutex);
38003800
}
38013801

3802-
#else
3803-
3804-
static inline __init void of_unittest_overlay_high_level(void) {}
3805-
3806-
#endif
3807-
3808-
#ifdef CONFIG_PCI_DYNAMIC_OF_NODES
3809-
38103802
static int of_unittest_pci_dev_num;
38113803
static int of_unittest_pci_child_num;
38123804

@@ -3954,6 +3946,9 @@ static void __init of_unittest_pci_node(void)
39543946
struct pci_dev *pdev = NULL;
39553947
int rc;
39563948

3949+
if (!IS_ENABLED(CONFIG_PCI_DYNAMIC_OF_NODES))
3950+
return;
3951+
39573952
rc = pci_register_driver(&testdrv_driver);
39583953
unittest(!rc, "Failed to register pci test driver; rc = %d\n", rc);
39593954
if (rc)
@@ -3987,7 +3982,10 @@ static void __init of_unittest_pci_node(void)
39873982
pci_dev_put(pdev);
39883983
}
39893984
#else
3990-
static void __init of_unittest_pci_node(void) { }
3985+
3986+
static inline __init void of_unittest_overlay_high_level(void) {}
3987+
static inline __init void of_unittest_pci_node(void) { }
3988+
39913989
#endif
39923990

39933991
static int __init of_unittest(void)

0 commit comments

Comments
 (0)