summaryrefslogtreecommitdiffstats
path: root/commands/oftree.c
diff options
context:
space:
mode:
Diffstat (limited to 'commands/oftree.c')
-rw-r--r--commands/oftree.c30
1 files changed, 4 insertions, 26 deletions
diff --git a/commands/oftree.c b/commands/oftree.c
index 299c2edfcd..76227a10b0 100644
--- a/commands/oftree.c
+++ b/commands/oftree.c
@@ -1,26 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0-only
+// SPDX-FileCopyrightText: © 2011 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
+
/*
* oftree.c - device tree command support
*
- * Copyright (c) 2011 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
- *
* based on U-Boot code by:
*
* Gerald Van Baren, Custom IDEAS, vanbaren@cideas.com
* Pantelis Antoniou <pantelis.antoniou@gmail.com> and
* Matthew McClintock <msm@freescale.com>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
*/
#include <common.h>
@@ -43,7 +31,6 @@
static int do_oftree(int argc, char *argv[])
{
struct fdt_header *fdt = NULL;
- size_t size;
int opt;
int probe = 0;
char *load = NULL;
@@ -88,16 +75,7 @@ static int do_oftree(int argc, char *argv[])
}
if (load) {
- fdt = read_file(load, &size);
- if (!fdt) {
- printf("unable to read %s\n", load);
- return 1;
- }
-
- root = of_unflatten_dtb(fdt);
-
- free(fdt);
-
+ root = of_read_file(load);
if (IS_ERR(root))
return PTR_ERR(root);