]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: soc-acpi: Set mach->id field on comp_ids matches
authorHans de Goede <hdegoede@redhat.com>
Thu, 18 Nov 2021 15:30:14 +0000 (16:30 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 22 Nov 2021 15:40:01 +0000 (15:40 +0000)
commit65c034ab817ea717b649d4189a219fb3008ddee8
tree97ea6368f5c6825682153984f88c3b9b465fe5d4
parenta0ae71695d6cea490a0db9a665af27a2558a1961
ASoC: soc-acpi: Set mach->id field on comp_ids matches

Commit 0bd99d1446ec ("ASoC: Intel: soc-acpi-byt: shrink tables using
compatible IDs") and commit cf572e03d015 ("ASoC: Intel: soc-acpi-cht:
shrink tables using compatible IDs") simplified the match tables in
soc-acpi-intel-byt-match.c and soc-acpi-intel-cht-match.c by merging
identical entries using the new .comp_ids snd_soc_acpi_mach field to
point a single entry to multiple ACPI HIDs and clearing the previously
unique per entry .id field.

But various machine drivers from sound/soc/intel/boards rely on mach->id
in one or more ways, e.g. some drivers contain the following snippets:

adev = acpi_dev_get_first_match_dev(mach->id, NULL, -1);

pkg_found = snd_soc_acpi_find_package_from_hid(mach->id, ...

if (!strncmp(snd_soc_cards[i].codec_id, mach->id, 8)) { ...

All of which are broken by the match table shrinking.

Make the snd_soc_acpi_mach.id field non const (the storage for the tables
already is non const) and on a comps_ids match copy the matching HID to
the id field to fix this.

Fixes: 0bd99d1446ec ("ASoC: Intel: soc-acpi-byt: shrink tables using compatible IDs")
Fixes: cf572e03d015 ("ASoC: Intel: soc-acpi-cht: shrink tables using compatible IDs")
Suggested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Brent Lu <brent.lu@intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211118153014.349222-1-hdegoede@redhat.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/soc-acpi.h
sound/soc/soc-acpi.c