Skip to content

Commit a8657e6

Browse files
keyonjiegregkh
authored andcommitted
ASoC: acpi: fix: continue searching when machine is ignored
[ Upstream commit a3e620f ] The machine_quirk may return NULL which means the acpi entries should be skipped and search for next matched entry is needed, here add return check here and continue for NULL case. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 2a031ca commit a8657e6

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

‎sound/soc/soc-acpi.c‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,17 @@ struct snd_soc_acpi_mach *
1010
snd_soc_acpi_find_machine(struct snd_soc_acpi_mach *machines)
1111
{
1212
struct snd_soc_acpi_mach *mach;
13+
struct snd_soc_acpi_mach *mach_alt;
1314

1415
for (mach = machines; mach->id[0]; mach++) {
1516
if (acpi_dev_present(mach->id, NULL, -1)) {
16-
if (mach->machine_quirk)
17-
mach = mach->machine_quirk(mach);
17+
if (mach->machine_quirk) {
18+
mach_alt = mach->machine_quirk(mach);
19+
if (!mach_alt)
20+
continue; /* not full match, ignore */
21+
mach = mach_alt;
22+
}
23+
1824
return mach;
1925
}
2026
}

0 commit comments

Comments
 (0)