of: Allow overlay kunit tests to run CONFIG_OF_OVERLAY=n

Some configurations want to enable CONFIG_KUNIT without enabling
CONFIG_OF_OVERLAY. The kunit overlay code already skips if
CONFIG_OF_OVERLAY isn't enabled, so this select here isn't really doing
anything besides making it easier to run the tests without them
skipping. Remove the select and move the config setting to the
drivers/of/.kunitconfig file so that the overlay tests can be run with
or without CONFIG_OF_OVERLAY set to test either behavior.

Fixes: 5c9dd72d83 ("of: Add a KUnit test for overlays and test managed APIs")
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20241016212016.887552-1-sboyd@kernel.org
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
This commit is contained in:
Stephen Boyd 2024-10-16 14:20:15 -07:00 committed by Rob Herring (Arm)
parent 6e0391e48c
commit 332857fdac
3 changed files with 4 additions and 1 deletions

View File

@ -1,4 +1,5 @@
CONFIG_KUNIT=y CONFIG_KUNIT=y
CONFIG_OF=y CONFIG_OF=y
CONFIG_OF_KUNIT_TEST=y CONFIG_OF_KUNIT_TEST=y
CONFIG_OF_OVERLAY=y
CONFIG_OF_OVERLAY_KUNIT_TEST=y CONFIG_OF_OVERLAY_KUNIT_TEST=y

View File

@ -111,7 +111,7 @@ config OF_OVERLAY_KUNIT_TEST
tristate "Device Tree overlay KUnit tests" if !KUNIT_ALL_TESTS tristate "Device Tree overlay KUnit tests" if !KUNIT_ALL_TESTS
depends on KUNIT depends on KUNIT
default KUNIT_ALL_TESTS default KUNIT_ALL_TESTS
select OF_OVERLAY select DTC
help help
This option builds KUnit unit tests for the device tree overlay code. This option builds KUnit unit tests for the device tree overlay code.

View File

@ -65,6 +65,8 @@ static void of_overlay_apply_kunit_cleanup(struct kunit *test)
struct device_node *np; struct device_node *np;
of_root_kunit_skip(test); of_root_kunit_skip(test);
if (!IS_ENABLED(CONFIG_OF_OVERLAY))
kunit_skip(test, "requires CONFIG_OF_OVERLAY to apply overlay");
if (!IS_ENABLED(CONFIG_OF_EARLY_FLATTREE)) if (!IS_ENABLED(CONFIG_OF_EARLY_FLATTREE))
kunit_skip(test, "requires CONFIG_OF_EARLY_FLATTREE for root node"); kunit_skip(test, "requires CONFIG_OF_EARLY_FLATTREE for root node");