aboutsummaryrefslogtreecommitdiffstats
path: root/sound/drivers/dummy.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/drivers/dummy.c')
-rw-r--r--sound/drivers/dummy.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c
index 83ac4980c5fb..4e4c69e6cb4c 100644
--- a/sound/drivers/dummy.c
+++ b/sound/drivers/dummy.c
@@ -230,13 +230,14 @@ static int snd_card_dummy_pcm_prepare(struct snd_pcm_substream *substream)
230{ 230{
231 struct snd_pcm_runtime *runtime = substream->runtime; 231 struct snd_pcm_runtime *runtime = substream->runtime;
232 struct snd_dummy_pcm *dpcm = runtime->private_data; 232 struct snd_dummy_pcm *dpcm = runtime->private_data;
233 unsigned int bps; 233 int bps;
234
235 bps = snd_pcm_format_width(runtime->format) * runtime->rate *
236 runtime->channels / 8;
234 237
235 bps = runtime->rate * runtime->channels;
236 bps *= snd_pcm_format_width(runtime->format);
237 bps /= 8;
238 if (bps <= 0) 238 if (bps <= 0)
239 return -EINVAL; 239 return -EINVAL;
240
240 dpcm->pcm_bps = bps; 241 dpcm->pcm_bps = bps;
241 dpcm->pcm_hz = HZ; 242 dpcm->pcm_hz = HZ;
242 dpcm->pcm_buffer_size = snd_pcm_lib_buffer_bytes(substream); 243 dpcm->pcm_buffer_size = snd_pcm_lib_buffer_bytes(substream);