From: Kuninori Morimoto Date: Tue, 9 Mar 2021 01:07:53 +0000 (+0900) Subject: ASoC: soc-pcm: direct copy at snd_soc_set_runtime_hwparams() X-Git-Tag: accepted/tizen/unified/20230118.172025~7091^2~1^2~184^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=56e749ba756fdc2eff332b8eadda8fca231ad782;p=platform%2Fkernel%2Flinux-rpi.git ASoC: soc-pcm: direct copy at snd_soc_set_runtime_hwparams() snd_soc_set_runtime_hwparams() is called from each driver to initialize hw parameters, but coping each parameters one-by-one. Current code is not copying all parameters, but no big effect if we do it. This patch copies all parameters by simple code. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87h7lluoba.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 60e688b..6f2de27 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -300,15 +300,8 @@ bool snd_soc_runtime_ignore_pmdown_time(struct snd_soc_pcm_runtime *rtd) int snd_soc_set_runtime_hwparams(struct snd_pcm_substream *substream, const struct snd_pcm_hardware *hw) { - struct snd_pcm_runtime *runtime = substream->runtime; - runtime->hw.info = hw->info; - runtime->hw.formats = hw->formats; - runtime->hw.period_bytes_min = hw->period_bytes_min; - runtime->hw.period_bytes_max = hw->period_bytes_max; - runtime->hw.periods_min = hw->periods_min; - runtime->hw.periods_max = hw->periods_max; - runtime->hw.buffer_bytes_max = hw->buffer_bytes_max; - runtime->hw.fifo_size = hw->fifo_size; + substream->runtime->hw = *hw; + return 0; } EXPORT_SYMBOL_GPL(snd_soc_set_runtime_hwparams);