summaryrefslogtreecommitdiff
path: root/src/drivers/generic/adau7002/adau7002.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/generic/adau7002/adau7002.c')
-rw-r--r--src/drivers/generic/adau7002/adau7002.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/drivers/generic/adau7002/adau7002.c b/src/drivers/generic/adau7002/adau7002.c
index d21d513c59..0a94819ec2 100644
--- a/src/drivers/generic/adau7002/adau7002.c
+++ b/src/drivers/generic/adau7002/adau7002.c
@@ -29,12 +29,17 @@
static void adau7002_fill_ssdt(struct device *dev)
{
- if (!dev->enabled)
+ if (!dev || !dev->enabled)
+ 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", ADAU7002_ACPI_HID);
acpigen_write_name_integer("_UID", 0);
acpigen_write_name_string("_DDN", dev->chip_ops->name);