]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
ASoC: acpi: fix machine driver selection based on quirk
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Fri, 5 Jan 2018 20:55:33 +0000 (14:55 -0600)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 22 Feb 2018 14:15:54 +0000 (08:15 -0600)
BugLink: http://bugs.launchpad.net/bugs/1751064
commit 5c256045b87b8aa8e5bc9d2e2fdc0802351c1f99 upstream.

The ACPI/machine-driver code refactoring introduced in 4.13 introduced
a regression for cases where we need a DMI-based quirk to select the
machine driver (the BIOS reports an invalid HID). The fix is just to
make sure the results of the quirk are actually used.

Fixes: 54746dabf770 ('ASoC: Improve machine driver selection based on quirk data')
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=96691
Tested-by: Nicole Færber <nicole.faerber@dpin.de>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
sound/soc/soc-acpi.c

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;