diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2023-05-19 12:01:17 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2023-05-25 09:36:01 +0200 |
commit | 760914f2585956db23e7d4196649a09e6aba9b21 (patch) | |
tree | a654f16b41b46a4b4c24f81f8fd7ff138f65c4bd /commands | |
parent | 035ca2a10ef2b5776629eadb6ea97b22b7978ccb (diff) | |
download | barebox-760914f2585956db23e7d4196649a09e6aba9b21.tar.gz barebox-760914f2585956db23e7d4196649a09e6aba9b21.tar.xz |
commands: of_property: use new of_read_file
Recent addition of of_read_file also involved switching over nearly all
open coded instances to use it. of_property seems the only remaining
instance where of_read_file can be used, but isn't. Switch it over.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20230519100120.2365970-4-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
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) { |