diff options
author | Takashi Iwai <tiwai@suse.de> | 2008-08-21 07:00:13 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-08-25 03:57:18 -0400 |
commit | 77a23f2695bb2de0cd74599400dc55109c531b72 (patch) | |
tree | 4960195e04016928dea83deb85e0f3bf97024a8a /sound/pci/emu10k1 | |
parent | 46480b3a5f88f20dbf25d95fe74d7b4798d5bc86 (diff) |
ALSA: Clean up SG-buffer helper functions and macros
Clean up SG-buffer helper functions and macros. Helpers take substream
as arguments now.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/pci/emu10k1')
-rw-r--r-- | sound/pci/emu10k1/memory.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/sound/pci/emu10k1/memory.c b/sound/pci/emu10k1/memory.c index e8ad56ed34fa..6a47672f930a 100644 --- a/sound/pci/emu10k1/memory.c +++ b/sound/pci/emu10k1/memory.c | |||
@@ -296,7 +296,6 @@ struct snd_util_memblk * | |||
296 | snd_emu10k1_alloc_pages(struct snd_emu10k1 *emu, struct snd_pcm_substream *substream) | 296 | snd_emu10k1_alloc_pages(struct snd_emu10k1 *emu, struct snd_pcm_substream *substream) |
297 | { | 297 | { |
298 | struct snd_pcm_runtime *runtime = substream->runtime; | 298 | struct snd_pcm_runtime *runtime = substream->runtime; |
299 | struct snd_sg_buf *sgbuf = snd_pcm_substream_sgbuf(substream); | ||
300 | struct snd_util_memhdr *hdr; | 299 | struct snd_util_memhdr *hdr; |
301 | struct snd_emu10k1_memblk *blk; | 300 | struct snd_emu10k1_memblk *blk; |
302 | int page, err, idx; | 301 | int page, err, idx; |
@@ -321,16 +320,9 @@ snd_emu10k1_alloc_pages(struct snd_emu10k1 *emu, struct snd_pcm_substream *subst | |||
321 | */ | 320 | */ |
322 | idx = 0; | 321 | idx = 0; |
323 | for (page = blk->first_page; page <= blk->last_page; page++, idx++) { | 322 | for (page = blk->first_page; page <= blk->last_page; page++, idx++) { |
323 | unsigned long ofs = idx << PAGE_SHIFT; | ||
324 | dma_addr_t addr; | 324 | dma_addr_t addr; |
325 | #ifdef CONFIG_SND_DEBUG | 325 | addr = snd_pcm_sgbuf_get_addr(substream, ofs); |
326 | if (idx >= sgbuf->pages) { | ||
327 | printk(KERN_ERR "emu: pages overflow! (%d-%d) for %d\n", | ||
328 | blk->first_page, blk->last_page, sgbuf->pages); | ||
329 | mutex_unlock(&hdr->block_mutex); | ||
330 | return NULL; | ||
331 | } | ||
332 | #endif | ||
333 | addr = sgbuf->table[idx].addr; | ||
334 | if (! is_valid_page(emu, addr)) { | 326 | if (! is_valid_page(emu, addr)) { |
335 | printk(KERN_ERR "emu: failure page = %d\n", idx); | 327 | printk(KERN_ERR "emu: failure page = %d\n", idx); |
336 | mutex_unlock(&hdr->block_mutex); | 328 | mutex_unlock(&hdr->block_mutex); |