Browse Source

[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>
GuEe-GUI 5 months ago
parent
commit
12fded19f5
1 changed files with 1 additions and 1 deletions
  1. 1 1
      components/drivers/ofw/fdt.c

+ 1 - 1
components/drivers/ofw/fdt.c

@@ -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");