ASoC: topology: Change allocations to resource managed
authorAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Fri, 30 Oct 2020 14:54:25 +0000 (10:54 -0400)
committerMark Brown <broonie@kernel.org>
Wed, 4 Nov 2020 17:51:07 +0000 (17:51 +0000)
commitff922622443767b27232eb01bae1d9a8d42df073
tree5bd2e0e06b101bfe4a1c14d88a91d875d2e69251
parente59db12b8df3ab07dcfe3540ecdf782d4272f263
ASoC: topology: Change allocations to resource managed

In order for topology to be resource managed, change all allocations to
be resource managed:
k*alloc -> devm_k*alloc
kstrdup -> devm_kstrdup

Exceptions where non resource managed allocation is left is
soc_tplg_dapm_widget_create(), as it uses pointer to memory locally and
frees it up after use, as well as soc_tplg_dapm_graph_elems_load(),
which has temporary pointer to table of routes.

After conversion all redundant calls in error and clean up paths were
removed.

Also removed some variables which become unneeded when there is no calls
using them.

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