of: unittest: Cleanup partially-applied overlays
authorGeert Uytterhoeven <geert+renesas@glider.be>
Fri, 28 Jul 2023 08:50:33 +0000 (10:50 +0200)
committerRob Herring <robh@kernel.org>
Thu, 24 Aug 2023 01:04:17 +0000 (20:04 -0500)
commit0676aeeca537740a03ecdb8b699b37e98ec60289
tree8ff48cb19cc997fa819115737a85ceabc1092bca
parentb7a46e7b44115e186a68a7d95bef5e7d72826304
of: unittest: Cleanup partially-applied overlays

When of_overlay_fdt_apply() fails, the changeset may be partially
applied, and the caller is still expected to call of_overlay_remove() to
clean up this partial state.  However, overlay_17 is the only test that
takes care of cleaning up after an (expected) failure.

Instead of adding cleanup code to each individual test, extend
overlay_info with the optional expected return value of
of_overlay_remove(), and handle cleanup in the overlay_data_apply()
helper.  While at it, simplify the end marker in the overlay_info table.

Update the expected error output for errors during the newly cleanup.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/594a6a8934e5569bf96d317a6a3c0a9129a2ae20.1690533838.git.geert+renesas@glider.be
[robh: update and fix EXPECT messages]
Signed-off-by: Rob Herring <robh@kernel.org>
drivers/of/unittest.c