diff options
Diffstat (limited to 'commands')
-rw-r--r-- | commands/of_property.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/commands/of_property.c b/commands/of_property.c index b507a3541e..0c914c55c6 100644 --- a/commands/of_property.c +++ b/commands/of_property.c @@ -305,7 +305,6 @@ static int do_of_property(int argc, char *argv[]) char *path, *propname; char *dtbfile = NULL; int ret = 0; - size_t size; struct fdt_header *fdt = NULL; struct device_node *root = NULL; @@ -340,15 +339,9 @@ static int do_of_property(int argc, char *argv[]) return COMMAND_ERROR_USAGE; if (dtbfile) { - fdt = read_file(dtbfile, &size); - if (!fdt) { - printf("unable to read %s: %m\n", dtbfile); - return -errno; - } - - root = of_unflatten_dtb(fdt, size); - - free(fdt); + root = of_read_file(dtbfile); + if (IS_ERR(root)) + return PTR_ERR(root); } if (set) { |