]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: soc-core: use devm_kzalloc() for rtd
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Wed, 2 Oct 2019 05:22:32 +0000 (14:22 +0900)
committerMark Brown <broonie@kernel.org>
Thu, 3 Oct 2019 13:35:42 +0000 (14:35 +0100)
commitc26b9c923958370d948b33b136300f46ecf9d508
tree4392afe1ff1944a51a6e7aeabb92cc1ce3d20530
parentc3b82ef81d85cbb2473ad7cf5cf43f7f7c982d52
ASoC: soc-core: use devm_kzalloc() for rtd

Current rtd, rtd->dev, rtd->codec_dais are created by normal kzalloc(),
but we want to use devm_kzalloc() as much as possible.

Created rtd->dev is registered by device_register() at
soc_new_pcm_runtime(), and it will be freed at
soc_free_pcm_runtime() by device_unregister().

This means, if we can use devm_kzalloc(rtd->dev, xxx) for
rtd / rtd->codec_dais, all these are automatically freed
via soc_free_pcm_runtime().
This patch uses devm_kzalloc(rtd->dev, xxx) for rtd / rtd->codec_dais.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/877e5nbu1z.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-core.c