mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-24 21:54:01 +00:00
common: image-android-dt: Fix logic in print fdt info routine
Do not attempt to print fdt info if root node wasn't found. Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
This commit is contained in:
parent
bddd985734
commit
24434adbd1
1 changed files with 6 additions and 5 deletions
|
@ -78,17 +78,18 @@ static void android_dt_print_fdt_info(const struct fdt_header *fdt)
|
||||||
{
|
{
|
||||||
u32 fdt_size;
|
u32 fdt_size;
|
||||||
int root_node_off;
|
int root_node_off;
|
||||||
const char *compatible = NULL;
|
const char *compatible;
|
||||||
|
|
||||||
fdt_size = fdt_totalsize(fdt);
|
|
||||||
root_node_off = fdt_path_offset(fdt, "/");
|
root_node_off = fdt_path_offset(fdt, "/");
|
||||||
if (root_node_off < 0) {
|
if (root_node_off < 0) {
|
||||||
printf("Error: Root node not found\n");
|
printf("Error: Root node not found\n");
|
||||||
} else {
|
return;
|
||||||
compatible = fdt_getprop(fdt, root_node_off, "compatible",
|
|
||||||
NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fdt_size = fdt_totalsize(fdt);
|
||||||
|
compatible = fdt_getprop(fdt, root_node_off, "compatible",
|
||||||
|
NULL);
|
||||||
|
|
||||||
printf(" (FDT)size = %d\n", fdt_size);
|
printf(" (FDT)size = %d\n", fdt_size);
|
||||||
printf(" (FDT)compatible = %s\n",
|
printf(" (FDT)compatible = %s\n",
|
||||||
compatible ? compatible : "(unknown)");
|
compatible ? compatible : "(unknown)");
|
||||||
|
|
Loading…
Reference in a new issue