1
0
Fork 0

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: Naveen M <naveen.m@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
hifive-unleashed-5.1
Naveen M 2017-05-15 13:42:14 +05:30 committed by Mark Brown
parent 915ae2b9f0
commit 7827d66946
2 changed files with 9 additions and 5 deletions

View File

@ -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;

View File

@ -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)
return mach;
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);