Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: soc-pcm: reuse dpcm_state_string()

We already have dpcm_state_string(). Let's reuse it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87y0xi52vx.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Kuninori Morimoto and committed by
Mark Brown
7a2ff051 2c2eadd0

+9 -9
+9 -9
sound/soc/soc-pcm.c
··· 144 144 return (rtd)->dai_link->num_codecs == 1 ? snd_soc_rtd_to_codec(rtd, 0)->name : "multicodec"; 145 145 } 146 146 147 - #ifdef CONFIG_DEBUG_FS 148 147 static const char *dpcm_state_string(enum snd_soc_dpcm_state state) 149 148 { 150 149 switch (state) { ··· 172 173 return "unknown"; 173 174 } 174 175 176 + #ifdef CONFIG_DEBUG_FS 175 177 static ssize_t dpcm_show_state(struct snd_soc_pcm_runtime *fe, 176 178 int stream, char *buf, size_t size) 177 179 { ··· 1636 1636 continue; 1637 1637 1638 1638 if (be->dpcm[stream].users == 0) { 1639 - dev_err(be->dev, "ASoC: no users %s at close - state %d\n", 1639 + dev_err(be->dev, "ASoC: no users %s at close - state %s\n", 1640 1640 snd_pcm_direction_name(stream), 1641 - be->dpcm[stream].state); 1641 + dpcm_state_string(be->dpcm[stream].state)); 1642 1642 continue; 1643 1643 } 1644 1644 ··· 1687 1687 1688 1688 /* first time the dpcm is open ? */ 1689 1689 if (be->dpcm[stream].users == DPCM_MAX_BE_USERS) { 1690 - dev_err(be->dev, "ASoC: too many users %s at open %d\n", 1690 + dev_err(be->dev, "ASoC: too many users %s at open %s\n", 1691 1691 snd_pcm_direction_name(stream), 1692 - be->dpcm[stream].state); 1692 + dpcm_state_string(be->dpcm[stream].state)); 1693 1693 continue; 1694 1694 } 1695 1695 ··· 1708 1708 if (err < 0) { 1709 1709 be->dpcm[stream].users--; 1710 1710 if (be->dpcm[stream].users < 0) 1711 - dev_err(be->dev, "ASoC: no users %s at unwind %d\n", 1711 + dev_err(be->dev, "ASoC: no users %s at unwind %s\n", 1712 1712 snd_pcm_direction_name(stream), 1713 - be->dpcm[stream].state); 1713 + dpcm_state_string(be->dpcm[stream].state)); 1714 1714 1715 1715 be->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE; 1716 1716 goto unwind; ··· 2572 2572 /* Only start the BE if the FE is ready */ 2573 2573 if (fe->dpcm[stream].state == SND_SOC_DPCM_STATE_HW_FREE || 2574 2574 fe->dpcm[stream].state == SND_SOC_DPCM_STATE_CLOSE) { 2575 - dev_err(fe->dev, "ASoC: FE %s is not ready %d\n", 2576 - fe->dai_link->name, fe->dpcm[stream].state); 2575 + dev_err(fe->dev, "ASoC: FE %s is not ready %s\n", 2576 + fe->dai_link->name, dpcm_state_string(fe->dpcm[stream].state)); 2577 2577 ret = -EINVAL; 2578 2578 goto disconnect; 2579 2579 }