soc/intel/common: sata: Opt out in sata_acpi_fill_ssdt() when not named

When soc_acpi_name() returns NULL do not create the AML code.

This prevents errors on the OS side when it tries to parse the AML
code and doesn't find a name string for the device:

ACPI Warning: Invalid character(s) in name (0x44415F08), repaired: [*_AD]

Change-Id: I72225a975663a1028283437cac3b9231b7c77ead
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/84830
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
This commit is contained in:
Patrick Rudolph 2024-10-22 08:24:18 +02:00 committed by Lean Sheng Tan
commit 6cdcd3f07d

View file

@ -10,12 +10,13 @@
static void sata_acpi_fill_ssdt(const struct device *dev)
{
const char *scope = acpi_device_scope(dev);
const char *name = soc_acpi_name(dev);
if (!scope)
if (!scope || !name)
return;
acpigen_write_scope(scope);
acpigen_write_device(soc_acpi_name(dev));
acpigen_write_device(name);
acpigen_write_ADR_pci_device(dev);
acpigen_write_STA(acpi_device_status(dev));
acpigen_pop_len(); /* Device */