ASoC: soc-pcm: add snd_soc_dpcm_can_be() and remove duplicate code
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Mon, 17 Feb 2020 08:28:07 +0000 (17:28 +0900)
committerMark Brown <broonie@kernel.org>
Tue, 18 Feb 2020 23:37:03 +0000 (23:37 +0000)
commit085d22be035db245c44714cf879a73eae06c9f6b
treecc8cc34f3b35cf938b909cf124c0d4754ce97495
parent289a7e64f8583aaa45847c7fa3b7fabf8d48fd6b
ASoC: soc-pcm: add snd_soc_dpcm_can_be() and remove duplicate code

Below functions are doing very similar things, the difference is
used state only.

snd_soc_dpcm_can_be_free_stop()
snd_soc_dpcm_can_be_params()

This patch adds common snd_soc_dpcm_check_state(), and use it from
snd_soc_dpcm_can_be_free_stop() / snd_soc_dpcm_can_be_params().
It can reduce duplicate code.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/878sl1bou2.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-pcm.c