1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-18 02:19:39 +00:00

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:
Kyle Evans 2017-12-28 21:09:36 +00:00
parent 3760a9ac78
commit a609d03b04
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=327298

View File

@ -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);
}