mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-24 15:31:22 +01:00
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>
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user