ASoC: Intel: Skylake: Shield against no-NHLT configurations
[sfrench/cifs-2.6.git] / sound / soc / intel / skylake / skl-nhlt.c
index 19f328d71f244687cf66e38a00d602665824bcaa..d9c8f5cb389e33289c9c57b6e330725e8f75568c 100644 (file)
@@ -182,7 +182,8 @@ void skl_nhlt_remove_sysfs(struct skl_dev *skl)
 {
        struct device *dev = &skl->pci->dev;
 
 {
        struct device *dev = &skl->pci->dev;
 
-       sysfs_remove_file(&dev->kobj, &dev_attr_platform_id.attr);
+       if (skl->nhlt)
+               sysfs_remove_file(&dev->kobj, &dev_attr_platform_id.attr);
 }
 
 /*
 }
 
 /*