]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: topology: Change topology device to card device
authorAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Fri, 15 Oct 2021 16:12:56 +0000 (18:12 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 29 Oct 2021 15:49:44 +0000 (16:49 +0100)
commit168f7a522e921311cc8cbd622458cfaa36fffc4f
treeb14fefbeab67f3ffe3861a33cfa8d71064ddaf88
parent418fcc475a2bd09f21bf20491a82d6fa94725fa0
ASoC: topology: Change topology device to card device

Topology needs device for prints and resource allocation. So far,
component->dev is used. However, this may lead to high memory use in
model where card is an independent driver which can be reloaded and
topology is loaded from component's probe() method. Every time machine
driver is reloaded topology is being loaded anew, each time allocating
new memory. Said memory will only be freed when component itself is
being freed.

Address the problem by tying topology to component->card->dev instead,
so memory occupied by the topology is freed whenever related machine
device gets removed.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20211015161257.27052-6-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-topology.c