MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_fdt_model_dump

Function rt_fdt_model_dump

components/drivers/ofw/fdt.c:506–528  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

504
505
506rt_err_t rt_fdt_model_dump(void)
507{
508 rt_err_t err = RT_EOK;
509 int root = fdt_path_offset(_fdt, "/");
510
511 if (root >= 0)
512 {
513 const char *mach_model = fdt_getprop(_fdt, root, "model", RT_NULL);
514
515 if (!mach_model)
516 {
517 mach_model = fdt_getprop(_fdt, root, "compatible", RT_NULL);
518 }
519
520 LOG_I("Machine model: %s", mach_model ? mach_model : "<undefined>");
521 }
522 else
523 {
524 err = -RT_EEMPTY;
525 }
526
527 return err;
528}
529
530rt_weak rt_err_t rt_fdt_boot_dump(void)
531{

Callers 1

Calls 2

fdt_path_offsetFunction · 0.50
fdt_getpropFunction · 0.50

Tested by

no test coverage detected