Skip to content

Commit 29e2435

Browse files
ctmarinasMatt Fleming
authored andcommitted
efi: fdt: Do not report an error during boot if UEFI is not available
Currently, fdt_find_uefi_params() reports an error if no EFI parameters are found in the DT. This is however a valid case for non-UEFI kernel booting. This patch checks changes the error reporting to a pr_info("UEFI not found") when no EFI parameters are found in the DT. Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Acked-by: Leif Lindholm <leif.lindholm@linaro.org> Tested-by: Leif Lindholm <leif.lindholm@linaro.org> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
1 parent a55c072 commit 29e2435

1 file changed

Lines changed: 15 additions & 7 deletions

File tree

  • drivers/firmware/efi

‎drivers/firmware/efi/efi.c‎

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ static __initdata struct {
346346

347347
struct param_info {
348348
int verbose;
349+
int found;
349350
void *params;
350351
};
351352

@@ -362,16 +363,12 @@ static int __init fdt_find_uefi_params(unsigned long node, const char *uname,
362363
(strcmp(uname, "chosen") != 0 && strcmp(uname, "chosen@0") != 0))
363364
return 0;
364365

365-
pr_info("Getting parameters from FDT:\n");
366-
367366
for (i = 0; i < ARRAY_SIZE(dt_params); i++) {
368367
prop = of_get_flat_dt_prop(node, dt_params[i].propname, &len);
369-
if (!prop) {
370-
pr_err("Can't find %s in device tree!\n",
371-
dt_params[i].name);
368+
if (!prop)
372369
return 0;
373-
}
374370
dest = info->params + dt_params[i].offset;
371+
info->found++;
375372

376373
val = of_read_number(prop, len / sizeof(u32));
377374

@@ -390,10 +387,21 @@ static int __init fdt_find_uefi_params(unsigned long node, const char *uname,
390387
int __init efi_get_fdt_params(struct efi_fdt_params *params, int verbose)
391388
{
392389
struct param_info info;
390+
int ret;
391+
392+
pr_info("Getting EFI parameters from FDT:\n");
393393

394394
info.verbose = verbose;
395+
info.found = 0;
395396
info.params = params;
396397

397-
return of_scan_flat_dt(fdt_find_uefi_params, &info);
398+
ret = of_scan_flat_dt(fdt_find_uefi_params, &info);
399+
if (!info.found)
400+
pr_info("UEFI not found.\n");
401+
else if (!ret)
402+
pr_err("Can't find '%s' in device tree!\n",
403+
dt_params[info.found].name);
404+
405+
return ret;
398406
}
399407
#endif /* CONFIG_EFI_PARAMS_FROM_FDT */

0 commit comments

Comments
 (0)