drivers/i2c/generic: Only write DDN field if description not empty

DDN field isn't required, no point in writing an empty string to it.

Change-Id: Ifea6e48c324598f114178e86a79f519ee35f5258
Signed-off-by: Matt DeVillier <matt.devillier@puri.sm>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/47781
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Matt DeVillier 2020-11-19 18:29:44 -06:00 committed by Patrick Georgi
parent 9226fe9aee
commit 86dce8fa75
1 changed files with 2 additions and 1 deletions

View File

@ -72,7 +72,8 @@ void i2c_generic_fill_ssdt(const struct device *dev,
if (config->cid)
acpigen_write_name_string("_CID", config->cid);
acpigen_write_name_integer("_UID", config->uid);
acpigen_write_name_string("_DDN", config->desc);
if (config->desc)
acpigen_write_name_string("_DDN", config->desc);
acpigen_write_STA(acpi_device_status(dev));
/* Resources */