Merge remote-tracking branch 'asoc/fix/intel' into asoc-linus
authorMark Brown <broonie@kernel.org>
Thu, 18 Jan 2018 11:55:25 +0000 (11:55 +0000)
committerMark Brown <broonie@kernel.org>
Thu, 18 Jan 2018 11:55:25 +0000 (11:55 +0000)
include/sound/soc-acpi-intel-match.h
include/sound/soc-acpi.h
sound/soc/intel/skylake/skl-nhlt.c
sound/soc/soc-acpi.c

index 1a9191cd4bb31ce1e6911c2c428387bf628ef889..9da6388c20a1cc6a5ab509b9800139583a495912 100644 (file)
@@ -16,6 +16,7 @@
 #ifndef __LINUX_SND_SOC_ACPI_INTEL_MATCH_H
 #define __LINUX_SND_SOC_ACPI_INTEL_MATCH_H
 
+#include <linux/module.h>
 #include <linux/stddef.h>
 #include <linux/acpi.h>
 
index a7d8d335b0437f397fb6c5a655ad51b8accc92bb..a93436089bf5388143b832a150c62f2bd6311143 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <linux/stddef.h>
 #include <linux/acpi.h>
+#include <linux/mod_devicetable.h>
 
 struct snd_soc_acpi_package_context {
        char *name;           /* package name */
index 3eaac41090ca7f8b07ed99511d58cbc1f5498c56..26b0a5caea5ab75707bf8461082e18524e80d816 100644 (file)
@@ -43,7 +43,8 @@ struct nhlt_acpi_table *skl_nhlt_init(struct device *dev)
        obj = acpi_evaluate_dsm(handle, &osc_guid, 1, 1, NULL);
        if (obj && obj->type == ACPI_TYPE_BUFFER) {
                nhlt_ptr = (struct nhlt_resource_desc  *)obj->buffer.pointer;
-               nhlt_table = (struct nhlt_acpi_table *)
+               if (nhlt_ptr->length)
+                       nhlt_table = (struct nhlt_acpi_table *)
                                memremap(nhlt_ptr->min_addr, nhlt_ptr->length,
                                MEMREMAP_WB);
                ACPI_FREE(obj);
index f21df28bc28e24eafc744fb8b524c26e9cbbd844..d4dd2efea45e4bf5b6e155368d50d24614c7019c 100644 (file)
@@ -84,11 +84,9 @@ snd_soc_acpi_find_machine(struct snd_soc_acpi_mach *machines)
 
        for (mach = machines; mach->id[0]; mach++) {
                if (snd_soc_acpi_check_hid(mach->id) == true) {
-                       if (mach->machine_quirk == NULL)
-                               return mach;
-
-                       if (mach->machine_quirk(mach) != NULL)
-                               return mach;
+                       if (mach->machine_quirk)
+                               mach = mach->machine_quirk(mach);
+                       return mach;
                }
        }
        return NULL;