aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@suse.cz>2005-01-03 13:48:48 +0100
committerJaroslav Kysela <perex@suse.cz>2005-01-03 13:48:48 +0100
commit33fff8c5238d876be02147ca2cdbeedc15be38c0 (patch)
tree89a096c9225f196ab7fbeb93f4e5c36382137756 /sound
parent1ca4bd4bb72378a027d92387f5126ada70e9f890 (diff)
downloadhistory-33fff8c5238d876be02147ca2cdbeedc15be38c0.tar.gz
[ALSA] Code clean up
EMU10K1/EMU10K2 driver Small code clean up. Use snd_pcm_lib_preallocage_pages_for_all() for buffer allocation. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/emu10k1/emu10k1x.c25
1 files changed, 6 insertions, 19 deletions
diff --git a/sound/pci/emu10k1/emu10k1x.c b/sound/pci/emu10k1/emu10k1x.c
index 557d5bc9647b57..c7fc8e756c8e15 100644
--- a/sound/pci/emu10k1/emu10k1x.c
+++ b/sound/pci/emu10k1/emu10k1x.c
@@ -575,15 +575,15 @@ static int snd_emu10k1x_pcm_open_capture(snd_pcm_substream_t *substream)
return err;
epcm = kcalloc(1, sizeof(*epcm), GFP_KERNEL);
- if (epcm == NULL) {
+ if (epcm == NULL)
return -ENOMEM;
- }
+
epcm->emu = chip;
epcm->substream = substream;
-
+
runtime->private_data = epcm;
runtime->private_free = snd_emu10k1x_pcm_free_substream;
-
+
runtime->hw = snd_emu10k1x_capture_hw;
return 0;
@@ -604,7 +604,7 @@ static int snd_emu10k1x_pcm_hw_params_capture(snd_pcm_substream_t *substream,
if (! epcm->voice) {
if (epcm->emu->capture_voice.use)
- return -1;
+ return -EBUSY;
epcm->voice = &epcm->emu->capture_voice;
epcm->voice->epcm = epcm;
epcm->voice->use = 1;
@@ -889,20 +889,7 @@ static int __devinit snd_emu10k1x_pcm(emu10k1x_t *emu, int device, snd_pcm_t **r
}
emu->pcm = pcm;
- for(substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream;
- substream;
- substream = substream->next)
- if ((err = snd_pcm_lib_preallocate_pages(substream,
- SNDRV_DMA_TYPE_DEV,
- snd_dma_pci_data(emu->pci),
- 32*1024, 32*1024)) < 0)
- return err;
-
- for (substream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream;
- substream;
- substream = substream->next)
- snd_pcm_lib_preallocate_pages(substream,
- SNDRV_DMA_TYPE_DEV,
+ snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
snd_dma_pci_data(emu->pci),
32*1024, 32*1024);