diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2018-02-03 05:25:20 -0500 |
---|---|---|
committer | Jean Delvare <jdelvare@suse.de> | 2018-02-03 05:25:20 -0500 |
commit | a81114d03e4a529c4b68293249f75438b3c1783f (patch) | |
tree | 0a15235314cb80327f135e18d4eb8786062122c8 | |
parent | a7770ae194569e96a93c48aceb304edded9cc648 (diff) |
firmware: dmi: handle missing DMI data gracefully
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>
-rw-r--r-- | drivers/firmware/dmi-sysfs.c | 2 | ||||
-rw-r--r-- | drivers/firmware/dmi_scan.c | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/drivers/firmware/dmi-sysfs.c b/drivers/firmware/dmi-sysfs.c index d5de6ee8466d..ecf2eeb5f6f9 100644 --- a/drivers/firmware/dmi-sysfs.c +++ b/drivers/firmware/dmi-sysfs.c | |||
@@ -652,7 +652,7 @@ static int __init dmi_sysfs_init(void) | |||
652 | int val; | 652 | int val; |
653 | 653 | ||
654 | if (!dmi_kobj) { | 654 | if (!dmi_kobj) { |
655 | pr_err("dmi-sysfs: dmi entry is absent.\n"); | 655 | pr_debug("dmi-sysfs: dmi entry is absent.\n"); |
656 | error = -ENODATA; | 656 | error = -ENODATA; |
657 | goto err; | 657 | goto err; |
658 | } | 658 | } |
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c index a7072e7880ee..e763e1484331 100644 --- a/drivers/firmware/dmi_scan.c +++ b/drivers/firmware/dmi_scan.c | |||
@@ -704,10 +704,8 @@ static int __init dmi_init(void) | |||
704 | u8 *dmi_table; | 704 | u8 *dmi_table; |
705 | int ret = -ENOMEM; | 705 | int ret = -ENOMEM; |
706 | 706 | ||
707 | if (!dmi_available) { | 707 | if (!dmi_available) |
708 | ret = -ENODATA; | 708 | return 0; |
709 | goto err; | ||
710 | } | ||
711 | 709 | ||
712 | /* | 710 | /* |
713 | * Set up dmi directory at /sys/firmware/dmi. This entry should stay | 711 | * Set up dmi directory at /sys/firmware/dmi. This entry should stay |