From: Xiang W Date: Tue, 11 Jun 2024 11:19:31 +0000 (+0800) Subject: lib: utils/serial: Skip initialize serial when dt is not enabled X-Git-Tag: v1.5~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=179e00a320df905f22cf2788880d5e1455795bf7;p=platform%2Fkernel%2Fopensbi.git 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 Reviewed-by: Anup Patel --- 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;