summaryrefslogtreecommitdiffstats
path: root/drivers/of/unittest.c
diff options
context:
space:
mode:
authorFrank Rowand <frank.rowand@sony.com>2017-07-19 09:25:20 -0700
committerRob Herring <robh@kernel.org>2017-07-20 09:36:13 -0500
commit60a0004cc9d66193ad9f1443315f52ec1086e25e (patch)
tree4131f8e868c2c20efd96e3e30ba9684b3073afe3 /drivers/of/unittest.c
parent0d638a07d3a1e98a7598eb2812a6236324e4c55f (diff)
downloadtalos-op-linux-60a0004cc9d66193ad9f1443315f52ec1086e25e.tar.gz
talos-op-linux-60a0004cc9d66193ad9f1443315f52ec1086e25e.zip
of: overlay: add overlay unittest data for node names and symbols
Add nodes and properties to overlay_base and overlay dts files to test for - incorrect existing node name detection when overlay node name has a unit-address - adding overlay __symbols__ properties to live tree when an overlay is added to the live tree The following console messages will appear near the end of unittest until the code errors are corrected: OF: Duplicate name in fairway-1, renamed to "ride@100#1" ### dt-test ### FAIL of_unittest_overlay_high_level():2296 Adding overlay 'overlay_bad_symbol' failed ### dt-test ### end of unittest - 190 passed, 1 failed Signed-off-by: Frank Rowand <frank.rowand@sony.com> Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'drivers/of/unittest.c')
-rw-r--r--drivers/of/unittest.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
index 0959e8cc8814..29a35cb1da64 100644
--- a/drivers/of/unittest.c
+++ b/drivers/of/unittest.c
@@ -1994,6 +1994,8 @@ out:
static inline void __init of_unittest_overlay(void) { }
#endif
+#ifdef CONFIG_OF_OVERLAY
+
/*
* __dtb_ot_begin[] and __dtb_ot_end[] are created by cmd_dt_S_dtb
* in scripts/Makefile.lib
@@ -2021,14 +2023,14 @@ struct overlay_info {
OVERLAY_INFO_EXTERN(overlay_base);
OVERLAY_INFO_EXTERN(overlay);
OVERLAY_INFO_EXTERN(overlay_bad_phandle);
-
-#ifdef CONFIG_OF_OVERLAY
+OVERLAY_INFO_EXTERN(overlay_bad_symbol);
/* order of entries is hard-coded into users of overlays[] */
static struct overlay_info overlays[] = {
OVERLAY_INFO(overlay_base, -9999),
OVERLAY_INFO(overlay, 0),
OVERLAY_INFO(overlay_bad_phandle, -EINVAL),
+ OVERLAY_INFO(overlay_bad_symbol, -EINVAL),
{}
};
@@ -2300,6 +2302,10 @@ static __init void of_unittest_overlay_high_level(void)
unittest(overlay_data_add(2),
"Adding overlay 'overlay_bad_phandle' failed\n");
+
+ unittest(overlay_data_add(3),
+ "Adding overlay 'overlay_bad_symbol' failed\n");
+
return;
err_unlock:
OpenPOWER on IntegriCloud