of: unittest: unflatten device tree on UML when testing
authorBrendan Higgins <brendanhiggins@google.com>
Tue, 19 Feb 2019 23:54:22 +0000 (15:54 -0800)
committerRob Herring <robh@kernel.org>
Thu, 28 Feb 2019 17:50:10 +0000 (11:50 -0600)
UML supports enabling OF, and is useful for running the device tree
tests, so add support for unflattening device tree blobs so we can
actually use it.

Signed-off-by: Brendan Higgins <brendanhiggins@google.com>
Reviewed-by: Frank Rowand <frank.rowand@sony.com>
Signed-off-by: Rob Herring <robh@kernel.org>
drivers/of/unittest.c

index 872956500c276382444f713b64b0c21596132cfe..66037511f2d707ae0d0f2392cfcf5e607500c4df 100644 (file)
@@ -2521,6 +2521,10 @@ static int __init of_unittest(void)
        int res;
 
        /* adding data for unittest */
+
+       if (IS_ENABLED(CONFIG_UML))
+               unittest_unflatten_overlay_base();
+
        res = unittest_data_add();
        if (res)
                return res;