ASoC: soc-pcm: use dai_get_widget() at dpcm_get_be()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Mon, 17 Feb 2020 08:27:43 +0000 (17:27 +0900)
committerMark Brown <broonie@kernel.org>
Tue, 18 Feb 2020 23:36:58 +0000 (23:36 +0000)
commit93597fae552a35d27cd1f399ffab6a6862cf9dc3
treec473cf0703c83ff8b600951d26f7a7782ac475be
parentd9303690f753dfdae51304fc89f4b04c0549a9f7
ASoC: soc-pcm: use dai_get_widget() at dpcm_get_be()

dpcm_get_be() has very duplicate code.

dpcm_get_be() {
...
if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
(1) /* code for Playback */
} else  {
(2) /* code for Capture */
}
}

The difference between Playback (1) and Capture (2) code is pointer only
(= "playback_widget" or "caputre_widget").
OTOH, now we already has dai_get_widget() for it.
This means we can merge (1) and (2).
This patch do it and remove duplicated 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/87ftf9bouq.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-pcm.c