summaryrefslogtreecommitdiff
path: root/sound/soc/qcom/common.c
diff options
context:
space:
mode:
authorStephan Gerhold <stephan@gerhold.net>2020-07-23 20:38:58 +0200
committerMark Brown <broonie@kernel.org>2020-07-24 15:01:15 +0100
commited3b53e7ffe91c32a1277de435e3fcb3ad5e852a (patch)
tree119fb785fb0489c66cbd9680b2079be6fecdcadf /sound/soc/qcom/common.c
parentd1e2a97b36131607d33ac3d02e569b494900f1bd (diff)
ASoC: qcom: Use devm for resource management
Simplify the machine drivers for newer SoCs a bit by using the devm_* function calls that automatically release the resources when the driver is removed or when probing fails. Signed-off-by: Stephan Gerhold <stephan@gerhold.net> Tested-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20200723183904.321040-2-stephan@gerhold.net Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/qcom/common.c')
-rw-r--r--sound/soc/qcom/common.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sound/soc/qcom/common.c b/sound/soc/qcom/common.c
index 8ada4ecba847..d677e83828af 100644
--- a/sound/soc/qcom/common.c
+++ b/sound/soc/qcom/common.c
@@ -36,7 +36,7 @@ int qcom_snd_parse_of(struct snd_soc_card *card)
num_links = of_get_child_count(dev->of_node);
/* Allocate the DAI link array */
- card->dai_link = kcalloc(num_links, sizeof(*link), GFP_KERNEL);
+ card->dai_link = devm_kcalloc(dev, num_links, sizeof(*link), GFP_KERNEL);
if (!card->dai_link)
return -ENOMEM;
@@ -143,7 +143,6 @@ err:
of_node_put(cpu);
of_node_put(codec);
of_node_put(platform);
- kfree(card->dai_link);
return ret;
}
EXPORT_SYMBOL(qcom_snd_parse_of);