Skip to content

Commit b094167

Browse files
fabiobaltierinashif
authored andcommitted
tests: cpp: add a pm device reference
On some architecture (qemu_x86) this tests generate an unused reference warning for the PM device structure, as nothing in the structure macro definition is referencing itself. Reference the struct in the device define, keep the compiler happy. Also change one of the device priority to dodge a '__device_dts_ord_8' causes a section type conflict with '__device_dts_ord_9' error with llvm. Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
1 parent c51df53 commit b094167

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/lib/cpp/cxx/src/main.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,11 @@ ZTEST_SUITE(cxx_tests, NULL, NULL, NULL, NULL, NULL);
145145
*
146146
* DEVICE_DEFINE(dev_id, name, * init_fn, pm, data, config, level, prio, api)
147147
*/
148-
DEVICE_DT_DEFINE(DT_NODELABEL(test_dev0_boot), NULL, NULL, NULL, NULL, POST_KERNEL, 33, NULL);
149-
150148
DEVICE_DT_DEFINE(DT_NODELABEL(test_dev1_dfr), NULL, NULL, NULL, NULL, POST_KERNEL, 33, NULL);
151149

152150
static int fake_pm_action(const struct device *dev,
153151
enum pm_device_action pm_action) { return -1; }
154152
PM_DEVICE_DT_DEFINE(DT_NODELABEL(test_dev0_boot), fake_pm_action);
153+
154+
DEVICE_DT_DEFINE(DT_NODELABEL(test_dev0_boot), NULL,
155+
PM_DEVICE_DT_GET(DT_NODELABEL(test_dev0_boot)), NULL, NULL, POST_KERNEL, 34, NULL);

0 commit comments

Comments
 (0)