Skip to content

Commit a81114d

Browse files
Ard Biesheuveljdelvare
authored andcommitted
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 <[email protected]> Acked-by: Martin Hundebøll <[email protected]> Signed-off-by: Jean Delvare <[email protected]>
1 parent a7770ae commit a81114d

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

drivers/firmware/dmi-sysfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ static int __init dmi_sysfs_init(void)
652652
int val;
653653

654654
if (!dmi_kobj) {
655-
pr_err("dmi-sysfs: dmi entry is absent.\n");
655+
pr_debug("dmi-sysfs: dmi entry is absent.\n");
656656
error = -ENODATA;
657657
goto err;
658658
}

drivers/firmware/dmi_scan.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -704,10 +704,8 @@ static int __init dmi_init(void)
704704
u8 *dmi_table;
705705
int ret = -ENOMEM;
706706

707-
if (!dmi_available) {
708-
ret = -ENODATA;
709-
goto err;
710-
}
707+
if (!dmi_available)
708+
return 0;
711709

712710
/*
713711
* Set up dmi directory at /sys/firmware/dmi. This entry should stay

0 commit comments

Comments
 (0)