ASoC: topology: Fix setting of stream rates, rate_min and rate_max
PATCH 1/1 ASoC: topology: Fix setting of stream rates, rate_min and rate_max
From: Mengdong Lin <[email protected]>
Directly set a stream's rates, rate_min and rate_max from the topology info. Also define set_stream_info to wrap setting of the stream info.
sound/soc/soc-topology.c +14 -14
@@ -1575,6 +1575,18 @@ static int soc_tplg_dapm_complete(struct soc_tplg *tplg)return 0 ; } +static int set_stream_info (struct snd_soc_pcm_stream *stream, +struct snd_soc_tplg_stream_caps *caps) +{ + stream->stream_name =kstrdup (caps->name,GFP_KERNEL ); + stream->channels_min = caps->channels_min; + stream->channels_max = caps->channels_max; + stream->rates = caps->rates; + stream->rate_min = caps->rate_min; + stream->rate_max = caps->rate_max; + stream->formats = caps->formats; +} +static int soc_tplg_dai_create (struct soc_tplg *tplg,struct snd_soc_tplg_pcm *pcm) {
@@ -1593,25 +1605,13 @@ static int soc_tplg_dai_create(struct soc_tplg *tplg,if (pcm->playback) { stream = &dai_drv->playback; caps = &pcm->caps[SND_SOC_TPLG_STREAM_PLAYBACK ]; - - stream->stream_name =kstrdup (caps->name,GFP_KERNEL ); - stream->channels_min = caps->channels_min; - stream->channels_max = caps->channels_max; - stream->rates =snd_pcm_rate_range_to_bits (caps->rate_min, - caps->rate_max); - stream->formats = caps->formats; +set_stream_info (stream, caps); }if (pcm->capture) { stream = &dai_drv->capture; caps = &pcm->caps[SND_SOC_TPLG_STREAM_CAPTURE ]; - - stream->stream_name =kstrdup (caps->name,GFP_KERNEL ); - stream->channels_min = caps->channels_min; - stream->channels_max = caps->channels_max; - stream->rates =snd_pcm_rate_range_to_bits (caps->rate_min, - caps->rate_max); - stream->formats = caps->formats; +set_stream_info (stream, caps); }/* pass control to component driver for optional further init */
Signature · 1 line
2.5.0
A message that is not in the archive (sent off-list or not yet received): 201602161403.uifzZpWI%[email protected]
Mark Brown
maintainerQuoted 4 lines · kbuild test robot
sound/soc/soc-topology.c: In function 'set_stream_info':Quoted 1 line
Quoted 1 line
sound/soc/soc-topology.c:1588:1: warning: no return statement in function returning non-void [-Wreturn-type]} ^
This is a real bug that 0day has identified.
Quoted 9 lines · Mark Brown
Quoted 4 lines · kbuild test robot
sound/soc/soc-topology.c: In function 'set_stream_info':Quoted 1 line
Quoted 1 line
sound/soc/soc-topology.c:1588:1: warning: no return statement in function returning non-void [-Wreturn-type]} ^This is a real bug that 0day has identified.
I'm sorry for the bug. Fixed this in v2 patch.
Thanks
Mengdong