summaryrefslogtreecommitdiff
path: root/include/kunit/of.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/kunit/of.h')
-rw-r--r--include/kunit/of.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/include/kunit/of.h b/include/kunit/of.h
index 48d4e70c9666..75a760a4e2a5 100644
--- a/include/kunit/of.h
+++ b/include/kunit/of.h
@@ -62,6 +62,13 @@ static inline int __of_overlay_apply_kunit(struct kunit *test,
&unused);
}
+#define of_overlay_begin(overlay_name) __dtbo_##overlay_name##_begin
+#define of_overlay_end(overlay_name) __dtbo_##overlay_name##_end
+
+#define OF_OVERLAY_DECLARE(overlay_name) \
+ extern uint8_t of_overlay_begin(overlay_name)[]; \
+ extern uint8_t of_overlay_end(overlay_name)[] \
+
/**
* of_overlay_apply_kunit() - Test managed of_overlay_fdt_apply() for built-in overlays
* @test: test context
@@ -104,12 +111,11 @@ static inline int __of_overlay_apply_kunit(struct kunit *test,
*/
#define of_overlay_apply_kunit(test, overlay_name) \
({ \
- extern uint8_t __dtbo_##overlay_name##_begin[]; \
- extern uint8_t __dtbo_##overlay_name##_end[]; \
+ OF_OVERLAY_DECLARE(overlay_name); \
\
__of_overlay_apply_kunit((test), \
- __dtbo_##overlay_name##_begin, \
- __dtbo_##overlay_name##_end); \
+ of_overlay_begin(overlay_name), \
+ of_overlay_end(overlay_name)); \
})
#endif