summaryrefslogtreecommitdiff
path: root/src/ec/google
diff options
context:
space:
mode:
authorEric Lai <eric_lai@quanta.corp-partner.google.com>2022-04-22 11:00:15 +0800
committerFelix Held <felix-coreboot@felixheld.de>2022-04-27 12:26:22 +0000
commitc3e4f6700586245d009937c44c78b3d9614785b7 (patch)
tree862ff0075647c0857f09195a3ac0e40e05d3ddd8 /src/ec/google
parent7e22ac15b298f579cffff67236ee09289ff74137 (diff)
ec/google/chromeec: Add empty string check for OEM string
If set OEM string as "", it shows "Not Specified" with dmidecode. Use default string if it is empty. BUG=b:230039300 TEST=set OEM string "" and show google with dmidecode -t 2. Signed-off-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Change-Id: I097e1be696ae974aadc47feb8d0c1dae672a5c82 Reviewed-on: https://review.coreboot.org/c/coreboot/+/63772 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Henry Sun <henrysun@google.com> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Kangheui Won <khwon@chromium.org>
Diffstat (limited to 'src/ec/google')
-rw-r--r--src/ec/google/chromeec/ec_smbios.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ec/google/chromeec/ec_smbios.c b/src/ec/google/chromeec/ec_smbios.c
index 0616c98685..d804f6431c 100644
--- a/src/ec/google/chromeec/ec_smbios.c
+++ b/src/ec/google/chromeec/ec_smbios.c
@@ -27,13 +27,13 @@ const char *smbios_mainboard_manufacturer(void)
if (manuf)
return manuf;
- if (google_chromeec_cbi_get_oem_name(&oem_name[0],
- ARRAY_SIZE(oem_name)) < 0) {
+ manuf = CONFIG_MAINBOARD_SMBIOS_MANUFACTURER;
+ if (google_chromeec_cbi_get_oem_name(&oem_name[0], ARRAY_SIZE(oem_name)) < 0)
printk(BIOS_INFO, "Couldn't obtain OEM name from CBI\n");
- manuf = CONFIG_MAINBOARD_SMBIOS_MANUFACTURER;
- } else {
+ else if (strlen(oem_name) > 0)
manuf = &oem_name[0];
- }
+ else
+ printk(BIOS_INFO, "OEM name from CBI is empty, use default\n");
return manuf;
}