• Kuninori Morimoto's avatar
    ASoC: soc-pcm.c: remove indirect runtime copy · 0d3a5178
    Kuninori Morimoto authored
    substream->runtime will be attached when substream was opened
    at snd_pcm_attach_substream(). When it uses DPCM,
    FE substream->runtime is attached, but BE substream->runtime is not.
    Thus, we are copying FE substream->runtime to BE.
    
    But, we are copyig FE substream->runtime to FE dpcm->runtime first (A),
    and copy it to BE dpcm->runtime (B), and copy it to
    BE substream->runtime (C).
    
    	static int dpcm_fe_dai_open(...) {
    		...
    (A)		fe->dpcm[stream].runtime = fe_substream->runtime;
    		...
    	}
    
    	static int dpcm_be_connect(...) {
    		...
    (B)		be->dpcm[stream].runtime = fe->dpcm[stream].runtime;
    		...
    	}
    
    	int dpcm_be_dai_startup(...) {
    		...
    (C)		be_substream->runtime = be->dpcm[stream].runtime;
    		...
    	}
    
    It is too roundabout and troublesome.
    OTOH, it is directly copying fe_substream->runtime at dpcm_be_reparent()
    without using be->dpcm[stream].runtime.
    
    	static void dpcm_be_reparent(...)
    	{
    		...
    		for_each_dpcm_fe(be, stream, dpcm) {
    			...
    =>			be_substream->runtime = fe_substream->runtime;
    			break;
    		}
    	}
    
    This patch removes indirect copying.
    Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
    Link: https://lore.kernel.org/r/87v8je64dh.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
    0d3a5178
soc-compress.c 17.8 KB