ASoC: Intel: sof_sdw: Allocate snd_soc_card dynamically
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Fri, 26 Apr 2024 15:21:17 +0000 (10:21 -0500)
committerMark Brown <broonie@kernel.org>
Mon, 29 Apr 2024 15:10:02 +0000 (00:10 +0900)
commit38068d91cf3948ffa220d45f738505cc9f6e13d0
treee3bf7f343d916a921669760832fb18b15ae517b5
parent6d339113df3ab510ce075a18ccb10a20cb325d4e
ASoC: Intel: sof_sdw: Allocate snd_soc_card dynamically

The static card_sof_sdw struct is modified during runtime and in case the
module is not removed, but the card is, then the next time the card is
created the card_sof_sdw will contain information from the previous card
which might lead to hard to debug issues, side effects.

Move the snd_soc_card into mc_private and use that to make sure that the
card is initialized correctly.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20240426152123.36284-7-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/boards/sof_sdw.c
sound/soc/intel/boards/sof_sdw_common.h