Unverified Commit f1b3ee78 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown
Browse files

ASoC: soc-core: add comment for rtd freeing



We don't need to mind freeing for rtd,
because it was created from devm_kzalloc(dev, xxx) which is rtd->dev.

This means, if rtd->dev was freed, rtd will be also freed
automatically.

	soc_new_pcm_runtime(...)
	{
		...
		rtd = devm_kzalloc(dev, ...);
		rtd->dev = dev;
		...
	}

This explanation was missing at soc_free_pcm_runtime() comment.
This patch indicates it.

Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87sg4dxldn.wl-kuninori.morimoto.gx@renesas.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent ad858508
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -413,6 +413,14 @@ static void soc_free_pcm_runtime(struct snd_soc_pcm_runtime *rtd)
	 * it is alloced *before* rtd.
	 * see
	 *	soc_new_pcm_runtime()
	 *
	 * We don't need to mind freeing for rtd,
	 * because it was created from dev (= rtd->dev)
	 * see
	 *	soc_new_pcm_runtime()
	 *
	 *		rtd = devm_kzalloc(dev, ...);
	 *		rtd->dev = dev
	 */
	device_unregister(rtd->dev);
}