* [PATCH] ASoC: topology: Fix setting of stream rates, rate_min and rate_max
@ 2016-02-16 6:12 mengdong.lin
[not found] ` <201602161403.uifzZpWI%fengguang.wu@intel.com>
0 siblings, 1 reply; 3+ messages in thread
From: mengdong.lin @ 2016-02-16 6:12 UTC (permalink / raw)
To: alsa-devel, broonie
Cc: lars, vinod.koul, hardik.t.shah, liam.r.girdwood, Mengdong Lin,
mengdong.lin, jeeja.kp, subhransu.s.prusty
From: Mengdong Lin <mengdong.lin@linux.intel.com>
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.
Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index 0eb01e8..2f7da32 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -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 */
--
2.5.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: topology: Fix setting of stream rates, rate_min and rate_max
[not found] ` <201602161403.uifzZpWI%fengguang.wu@intel.com>
@ 2016-02-19 16:16 ` Mark Brown
2016-02-22 8:31 ` Mengdong Lin
0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2016-02-19 16:16 UTC (permalink / raw)
To: kbuild test robot
Cc: alsa-devel, mengdong.lin, vinod.koul, hardik.t.shah,
liam.r.girdwood, lars, kbuild-all, mengdong.lin, jeeja.kp,
subhransu.s.prusty
[-- Attachment #1.1: Type: text/plain, Size: 306 bytes --]
On Tue, Feb 16, 2016 at 02:27:32PM +0800, kbuild test robot wrote:
> sound/soc/soc-topology.c: In function 'set_stream_info':
> >> 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.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: topology: Fix setting of stream rates, rate_min and rate_max
2016-02-19 16:16 ` Mark Brown
@ 2016-02-22 8:31 ` Mengdong Lin
0 siblings, 0 replies; 3+ messages in thread
From: Mengdong Lin @ 2016-02-22 8:31 UTC (permalink / raw)
To: Mark Brown, kbuild test robot
Cc: alsa-devel, lars, vinod.koul, hardik.t.shah, liam.r.girdwood,
kbuild-all, mengdong.lin, jeeja.kp, subhransu.s.prusty
On 02/20/2016 12:16 AM, Mark Brown wrote:
> On Tue, Feb 16, 2016 at 02:27:32PM +0800, kbuild test robot wrote:
>
>> sound/soc/soc-topology.c: In function 'set_stream_info':
>>>> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-02-22 8:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-16 6:12 [PATCH] ASoC: topology: Fix setting of stream rates, rate_min and rate_max mengdong.lin
[not found] ` <201602161403.uifzZpWI%fengguang.wu@intel.com>
2016-02-19 16:16 ` Mark Brown
2016-02-22 8:31 ` Mengdong Lin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).