[PATCH v2 3/6] commands: of_property: use new of_read_file
Ahmad Fatoum
a.fatoum at pengutronix.de
Fri May 19 03:01:17 PDT 2023
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 at pengutronix.de>
---
v1 -> v2:
- new patch
---
commands/of_property.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/commands/of_property.c b/commands/of_property.c
index b507a3541e0a..0c914c55c6bf 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) {
--
2.39.2
More information about the barebox
mailing list