summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/generic/max98357a/max98357a.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/drivers/generic/max98357a/max98357a.c b/src/drivers/generic/max98357a/max98357a.c
index 1408dacca6..838491dc84 100644
--- a/src/drivers/generic/max98357a/max98357a.c
+++ b/src/drivers/generic/max98357a/max98357a.c
@@ -36,9 +36,14 @@ static void max98357a_fill_ssdt(struct device *dev)
if (!dev->enabled || !config)
return;
+ const char *scope = acpi_device_scope(dev);
+ const char *name = acpi_device_name(dev);
+ if (!scope || !name)
+ return;
+
/* Device */
- acpigen_write_scope(acpi_device_scope(dev));
- acpigen_write_device(acpi_device_name(dev));
+ acpigen_write_scope(scope);
+ acpigen_write_device(name);
acpigen_write_name_string("_HID", MAX98357A_ACPI_HID);
acpigen_write_name_integer("_UID", 0);
acpigen_write_name_string("_DDN", dev->chip_ops->name);