diff options
author | Xiang W <wxjstz@126.com> | 2024-06-11 19:19:31 +0800 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2024-06-13 18:36:49 +0530 |
commit | 179e00a320df905f22cf2788880d5e1455795bf7 (patch) | |
tree | c3f44bddecf55aafca8ef281488ca60bbe0e3e16 | |
parent | b1c7c750f75dc027602688e4cb192d7b883c71d3 (diff) | |
download | opensbi-179e00a320df905f22cf2788880d5e1455795bf7.zip opensbi-179e00a320df905f22cf2788880d5e1455795bf7.tar.gz opensbi-179e00a320df905f22cf2788880d5e1455795bf7.tar.bz2 |
lib: utils/serial: Skip initialize serial when dt is not enabled
When the dt node has a status property and the value is not ok or
okay, skip initializing serial.
Signed-off-by: Xiang W <wxjstz@126.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
-rw-r--r-- | lib/utils/serial/fdt_serial.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/utils/serial/fdt_serial.c b/lib/utils/serial/fdt_serial.c index 0baa722..8b6e6b9 100644 --- a/lib/utils/serial/fdt_serial.c +++ b/lib/utils/serial/fdt_serial.c @@ -40,6 +40,10 @@ int fdt_serial_init(void) else noff = fdt_path_offset(fdt, prop); } + if (-1 < noff) { + if (!fdt_node_is_enabled(fdt, noff)) + noff = -1; + } } /* First check DT node pointed by stdout-path */ @@ -68,6 +72,9 @@ int fdt_serial_init(void) if (noff < 0) continue; + if (!fdt_node_is_enabled(fdt, noff)) + continue; + /* drv->init must not be NULL */ if (drv->init == NULL) return SBI_EFAIL; |