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

ASoC: remove dpcm_process_paths()

dpcm_process_paths() will call dpcm_add_paths() (A) or
dpcm_prune_paths() (B)

dpcm_process_paths(..., new)
{
if (new)
(A) return dpcm_add_paths(...);
else
(B) return dpcm_prune_paths(...);
}

but the user who need to call dpcm_prune_paths() (B) is only
soc_dpcm_fe_runtime_update(), all other user want to call is
dpcm_add_paths() (A). We don't need to have confusing
dpcm_process_paths(). Let's remove it.

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

authored by

Kuninori Morimoto and committed by
Mark Brown
40b1f89a 257a060f

+14 -20
+2 -2
include/sound/soc-dpcm.h
··· 132 132 int dpcm_path_get(struct snd_soc_pcm_runtime *fe, 133 133 int stream, struct snd_soc_dapm_widget_list **list_); 134 134 void dpcm_path_put(struct snd_soc_dapm_widget_list **list); 135 - int dpcm_process_paths(struct snd_soc_pcm_runtime *fe, 136 - int stream, struct snd_soc_dapm_widget_list **list, int new); 135 + int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream, 136 + struct snd_soc_dapm_widget_list **list_); 137 137 int dpcm_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream); 138 138 void dpcm_be_dai_stop(struct snd_soc_pcm_runtime *fe, int stream, 139 139 int do_hw_free, struct snd_soc_dpcm *last);
+1 -1
sound/soc/soc-compress.c
··· 148 148 snd_soc_dpcm_mutex_lock(fe); 149 149 150 150 /* calculate valid and active FE <-> BE dpcms */ 151 - dpcm_process_paths(fe, stream, &list, 1); 151 + dpcm_add_paths(fe, stream, &list); 152 152 153 153 fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_FE; 154 154
+11 -17
sound/soc/soc-pcm.c
··· 1550 1550 return prune; 1551 1551 } 1552 1552 1553 - static int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream, 1554 - struct snd_soc_dapm_widget_list **list_) 1553 + int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream, 1554 + struct snd_soc_dapm_widget_list **list_) 1555 1555 { 1556 1556 struct snd_soc_card *card = fe->card; 1557 1557 struct snd_soc_dapm_widget_list *list = *list_; ··· 1614 1614 1615 1615 dev_dbg(fe->dev, "ASoC: found %d new BE paths\n", new); 1616 1616 return new; 1617 - } 1618 - 1619 - /* 1620 - * Find the corresponding BE DAIs that source or sink audio to this 1621 - * FE substream. 1622 - */ 1623 - int dpcm_process_paths(struct snd_soc_pcm_runtime *fe, 1624 - int stream, struct snd_soc_dapm_widget_list **list, int new) 1625 - { 1626 - if (new) 1627 - return dpcm_add_paths(fe, stream, list); 1628 - else 1629 - return dpcm_prune_paths(fe, stream, list); 1630 1617 } 1631 1618 1632 1619 void dpcm_clear_pending_state(struct snd_soc_pcm_runtime *fe, int stream) ··· 2693 2706 return paths; 2694 2707 2695 2708 /* update any playback/capture paths */ 2696 - count = dpcm_process_paths(fe, stream, &list, new); 2709 + /* 2710 + * Find the corresponding BE DAIs that source or sink audio to this 2711 + * FE substream. 2712 + */ 2713 + if (new) 2714 + count = dpcm_add_paths(fe, stream, &list); 2715 + else 2716 + count = dpcm_prune_paths(fe, stream, &list); 2697 2717 if (count) { 2698 2718 dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_BE); 2699 2719 if (new) ··· 2792 2798 goto open_end; 2793 2799 2794 2800 /* calculate valid and active FE <-> BE dpcms */ 2795 - dpcm_process_paths(fe, stream, &list, 1); 2801 + dpcm_add_paths(fe, stream, &list); 2796 2802 2797 2803 ret = dpcm_fe_dai_startup(fe_substream); 2798 2804 if (ret < 0)