]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
ASoC: codecs: rt1308-sdw: simplify set_stream
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Fri, 24 Mar 2023 01:43:59 +0000 (09:43 +0800)
committerMark Brown <broonie@kernel.org>
Wed, 29 Mar 2023 14:03:02 +0000 (15:03 +0100)
commitce8ffc1bac7bee5015eb68faf214b39fcbd65d15
tree15415b411e44085d60e1f6140fb0983ccaf386ec
parent658d6f7381b1be5a6fec7d90c865fb593b8c78b6
ASoC: codecs: rt1308-sdw: simplify set_stream

Using a dynamic allocation to store a single pointer is not very
efficient/useful.

Worse, the memory is released in the SoundWire stream.c file, but
still accessed in the DAI shutdown, leading to kmemleak reports.

And last the API requires the previous stream information to be
cleared when the argument is NULL.

Simplify the code to address all 3 problems.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230324014408.1677505-5-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/rt1308-sdw.c
sound/soc/codecs/rt1308-sdw.h