4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-02-15 16:00:13 +08:00

[DM/FDT] Fixup earlycon loss old messages.

The `rt_fdt_scan_chosen_stdout` will init fdt_earlycon data
without `msg` only, the `msg_idx` should not clean, too.
Because we check if have old messages by `msg_idx`

Signed-off-by: GuEe-GUI <2991707448@qq.com>
This commit is contained in:
GuEe-GUI 2025-01-18 11:57:39 +08:00 committed by Rbb666
parent d3d33ff983
commit 12fded19f5

View File

@ -593,7 +593,7 @@ rt_err_t rt_fdt_scan_chosen_stdout(void)
int len, options_len = 0;
const char *options = RT_NULL, *con_type = RT_NULL;
rt_memset(&fdt_earlycon, 0, sizeof(fdt_earlycon) - sizeof(fdt_earlycon.msg));
rt_memset(&fdt_earlycon, 0, rt_offsetof(struct rt_fdt_earlycon, msg_idx));
fdt_earlycon.nodeoffset = -1;
offset = fdt_path_offset(_fdt, "/chosen");