Skip to content

Commit 9e58a1e

Browse files
mniestrojcfriedt
authored andcommitted
tests: drivers: build_all: add fake serial device for modem tests
Serial device is needed for building drivers that use DEVICE_DT_GET(). None of the currently used modem drivers use that right now, but this is about to change. Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
1 parent 09ad926 commit 9e58a1e

File tree

1 file changed

+8
-0
lines changed
  • tests/drivers/build_all/modem/src

1 file changed

+8
-0
lines changed

tests/drivers/build_all/modem/src/main.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,11 @@ void main(void)
2727
DEVICE_DT_DEFINE(DT_INST(0, vnd_gpio), NULL, NULL, NULL, NULL,
2828
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, NULL);
2929
#endif
30+
31+
#if DT_NODE_EXISTS(DT_INST(0, vnd_serial))
32+
/* Fake serial device, needed for building drivers that use DEVICE_DT_GET()
33+
* to access serial bus.
34+
*/
35+
DEVICE_DT_DEFINE(DT_INST(0, vnd_serial), NULL, NULL, NULL, NULL,
36+
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, NULL);
37+
#endif

0 commit comments

Comments
 (0)