firmware: dmi: handle missing DMI data gracefully
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Sat, 3 Feb 2018 10:25:20 +0000 (11:25 +0100)
committerJean Delvare <jdelvare@suse.de>
Sat, 3 Feb 2018 10:25:20 +0000 (11:25 +0100)
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>
drivers/firmware/dmi-sysfs.c
drivers/firmware/dmi_scan.c

index d5de6ee8466d51532d041ae5ff9b07dfd2d03ca5..ecf2eeb5f6f95d94627ab956e39ae95a986a63e7 100644 (file)
@@ -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;
        }
index a7072e7880eec55940fc9561d75a697100224588..e763e148433115328930debe838a8c2c20da430e 100644 (file)
@@ -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