Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7827d669 authored by Naveen M's avatar Naveen M Committed by Mark Brown
Browse files

ASoC: Move quirk to identify correct machine driver



sst_acpi_mach has a quirk field to handle board specific quirks.
Patch moves quirk call to sst_acpi_find_machine() instead of calling
it in respective driver

Signed-off-by: default avatarNaveen M <naveen.m@intel.com>
Signed-off-by: default avatarSubhransu S. Prusty <subhransu.s.prusty@intel.com>
Acked-by: default avatarVinod Koul <vinod.koul@intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 915ae2b9
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -303,8 +303,6 @@ static int sst_acpi_probe(struct platform_device *pdev)
		dev_err(dev, "No matching machine driver found\n");
		return -ENODEV;
	}
	if (mach->machine_quirk)
		mach = mach->machine_quirk(mach);

	pdata = mach->pdata;

+9 −3
Original line number Diff line number Diff line
@@ -81,9 +81,15 @@ struct sst_acpi_mach *sst_acpi_find_machine(struct sst_acpi_mach *machines)
{
	struct sst_acpi_mach *mach;

	for (mach = machines; mach->id[0]; mach++)
		if (sst_acpi_check_hid(mach->id) == true)
	for (mach = machines; mach->id[0]; mach++) {
		if (sst_acpi_check_hid(mach->id) == true) {
			if (mach->machine_quirk == NULL)
				return mach;

			if (mach->machine_quirk(mach) != NULL)
				return mach;
		}
	}
	return NULL;
}
EXPORT_SYMBOL_GPL(sst_acpi_find_machine);