aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of/unittest.c
diff options
context:
space:
mode:
authorFrank Rowand <frank.rowand@sony.com>2017-07-19 12:25:20 -0400
committerRob Herring <robh@kernel.org>2017-07-20 10:36:13 -0400
commit60a0004cc9d66193ad9f1443315f52ec1086e25e (patch)
tree4131f8e868c2c20efd96e3e30ba9684b3073afe3 /drivers/of/unittest.c
parent0d638a07d3a1e98a7598eb2812a6236324e4c55f (diff)
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:
1994static inline void __init of_unittest_overlay(void) { } 1994static inline void __init of_unittest_overlay(void) { }
1995#endif 1995#endif
1996 1996
1997#ifdef CONFIG_OF_OVERLAY
1998
1997/* 1999/*
1998 * __dtb_ot_begin[] and __dtb_ot_end[] are created by cmd_dt_S_dtb 2000 * __dtb_ot_begin[] and __dtb_ot_end[] are created by cmd_dt_S_dtb
1999 * in scripts/Makefile.lib 2001 * in scripts/Makefile.lib
@@ -2021,14 +2023,14 @@ struct overlay_info {
2021OVERLAY_INFO_EXTERN(overlay_base); 2023OVERLAY_INFO_EXTERN(overlay_base);
2022OVERLAY_INFO_EXTERN(overlay); 2024OVERLAY_INFO_EXTERN(overlay);
2023OVERLAY_INFO_EXTERN(overlay_bad_phandle); 2025OVERLAY_INFO_EXTERN(overlay_bad_phandle);
2024 2026OVERLAY_INFO_EXTERN(overlay_bad_symbol);
2025#ifdef CONFIG_OF_OVERLAY
2026 2027
2027/* order of entries is hard-coded into users of overlays[] */ 2028/* order of entries is hard-coded into users of overlays[] */
2028static struct overlay_info overlays[] = { 2029static struct overlay_info overlays[] = {
2029 OVERLAY_INFO(overlay_base, -9999), 2030 OVERLAY_INFO(overlay_base, -9999),
2030 OVERLAY_INFO(overlay, 0), 2031 OVERLAY_INFO(overlay, 0),
2031 OVERLAY_INFO(overlay_bad_phandle, -EINVAL), 2032 OVERLAY_INFO(overlay_bad_phandle, -EINVAL),
2033 OVERLAY_INFO(overlay_bad_symbol, -EINVAL),
2032 {} 2034 {}
2033}; 2035};
2034 2036
@@ -2300,6 +2302,10 @@ static __init void of_unittest_overlay_high_level(void)
2300 2302
2301 unittest(overlay_data_add(2), 2303 unittest(overlay_data_add(2),
2302 "Adding overlay 'overlay_bad_phandle' failed\n"); 2304 "Adding overlay 'overlay_bad_phandle' failed\n");
2305
2306 unittest(overlay_data_add(3),
2307 "Adding overlay 'overlay_bad_symbol' failed\n");
2308
2303 return; 2309 return;
2304 2310
2305err_unlock: 2311err_unlock: