Skip to content

Commit

Permalink
firmware: dmi: handle missing DMI data gracefully
Browse files Browse the repository at this point in the history
Currently, when booting a kernel with DMI support on a platform that has
no DMI tables, the following output is emitted into the kernel log:

  [    0.128818] DMI not present or invalid.
  ...
  [    1.306659] dmi: Firmware registration failed.
  ...
  [    2.908681] dmi-sysfs: dmi entry is absent.

The first one is a pr_info(), but the subsequent ones are pr_err()s that
complain about a condition that is not really an error to begin with.

So let's clean this up, and give up silently if dma_available is not set.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Martin Hundebøll <mnhu@prevas.dk>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
  • Loading branch information
Ard Biesheuvel authored and Jean Delvare committed Feb 3, 2018
1 parent a7770ae commit a81114d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion drivers/firmware/dmi-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ static int __init dmi_sysfs_init(void)
int val;

if (!dmi_kobj) {
pr_err("dmi-sysfs: dmi entry is absent.\n");
pr_debug("dmi-sysfs: dmi entry is absent.\n");
error = -ENODATA;
goto err;
}
Expand Down
6 changes: 2 additions & 4 deletions drivers/firmware/dmi_scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -704,10 +704,8 @@ static int __init dmi_init(void)
u8 *dmi_table;
int ret = -ENOMEM;

if (!dmi_available) {
ret = -ENODATA;
goto err;
}
if (!dmi_available)
return 0;

/*
* Set up dmi directory at /sys/firmware/dmi. This entry should stay
Expand Down

0 comments on commit a81114d

Please sign in to comment.