From 9e58a1e475473fcea1c3b0d05ac9c738141c821a Mon Sep 17 00:00:00 2001 From: Marcin Niestroj Date: Wed, 30 Jun 2021 17:19:33 +0200 Subject: [PATCH] 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 --- tests/drivers/build_all/modem/src/main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/drivers/build_all/modem/src/main.c b/tests/drivers/build_all/modem/src/main.c index 8d1d3ab0e65..4ce84a4f4e8 100644 --- a/tests/drivers/build_all/modem/src/main.c +++ b/tests/drivers/build_all/modem/src/main.c @@ -27,3 +27,11 @@ void main(void) DEVICE_DT_DEFINE(DT_INST(0, vnd_gpio), NULL, NULL, NULL, NULL, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, NULL); #endif + +#if DT_NODE_EXISTS(DT_INST(0, vnd_serial)) +/* Fake serial device, needed for building drivers that use DEVICE_DT_GET() + * to access serial bus. + */ +DEVICE_DT_DEFINE(DT_INST(0, vnd_serial), NULL, NULL, NULL, NULL, + POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, NULL); +#endif