stand/fdt: Fix loading of multiple fdt_overlays
fdt_load_dtb_overlays was written to unload previous overlay when a new valid one is come across. fdt_apply_overlays further down is written to iterate over all .dtbo's currently loaded and apply them one-by-one. Correct fdt_load_dtb_overlays to stop dropping valid overlays that were previously loaded and match expectations. Reviewed by: gonzo, imp Differential Revision: https://reviews.freebsd.org/D13659
This commit is contained in:
parent
508a3c553c
commit
c1d99c5791
@ -281,14 +281,12 @@ fdt_load_dtb_file(const char * filename)
|
||||
static int
|
||||
fdt_load_dtb_overlay(const char * filename)
|
||||
{
|
||||
struct preloaded_file *bfp, *oldbfp;
|
||||
struct preloaded_file *bfp;
|
||||
struct fdt_header header;
|
||||
int err;
|
||||
|
||||
debugf("fdt_load_dtb_overlay(%s)\n", filename);
|
||||
|
||||
oldbfp = file_findfile(filename, "dtbo");
|
||||
|
||||
/* Attempt to load and validate a new dtb from a file. */
|
||||
if ((bfp = file_loadraw(filename, "dtbo", 1)) == NULL) {
|
||||
printf("failed to load file '%s'\n", filename);
|
||||
@ -310,10 +308,6 @@ fdt_load_dtb_overlay(const char * filename)
|
||||
return (1);
|
||||
}
|
||||
|
||||
/* A new dtb was validated, discard any previous file. */
|
||||
if (oldbfp)
|
||||
file_discard(oldbfp);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user