diff options
Diffstat (limited to 'sound/pci/via82xx.c')
-rw-r--r-- | sound/pci/via82xx.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c index 84ea35d8b252..8766848bbe68 100644 --- a/sound/pci/via82xx.c +++ b/sound/pci/via82xx.c | |||
@@ -420,7 +420,6 @@ static int build_via_table(struct viadev *dev, struct snd_pcm_substream *substre | |||
420 | { | 420 | { |
421 | unsigned int i, idx, ofs, rest; | 421 | unsigned int i, idx, ofs, rest; |
422 | struct via82xx *chip = snd_pcm_substream_chip(substream); | 422 | struct via82xx *chip = snd_pcm_substream_chip(substream); |
423 | struct snd_sg_buf *sgbuf = snd_pcm_substream_sgbuf(substream); | ||
424 | 423 | ||
425 | if (dev->table.area == NULL) { | 424 | if (dev->table.area == NULL) { |
426 | /* the start of each lists must be aligned to 8 bytes, | 425 | /* the start of each lists must be aligned to 8 bytes, |
@@ -449,12 +448,14 @@ static int build_via_table(struct viadev *dev, struct snd_pcm_substream *substre | |||
449 | do { | 448 | do { |
450 | unsigned int r; | 449 | unsigned int r; |
451 | unsigned int flag; | 450 | unsigned int flag; |
451 | unsigned int addr; | ||
452 | 452 | ||
453 | if (idx >= VIA_TABLE_SIZE) { | 453 | if (idx >= VIA_TABLE_SIZE) { |
454 | snd_printk(KERN_ERR "via82xx: too much table size!\n"); | 454 | snd_printk(KERN_ERR "via82xx: too much table size!\n"); |
455 | return -EINVAL; | 455 | return -EINVAL; |
456 | } | 456 | } |
457 | ((u32 *)dev->table.area)[idx << 1] = cpu_to_le32((u32)snd_pcm_sgbuf_get_addr(sgbuf, ofs)); | 457 | addr = snd_pcm_sgbuf_get_addr(substream, ofs); |
458 | ((u32 *)dev->table.area)[idx << 1] = cpu_to_le32(addr); | ||
458 | r = PAGE_SIZE - (ofs % PAGE_SIZE); | 459 | r = PAGE_SIZE - (ofs % PAGE_SIZE); |
459 | if (rest < r) | 460 | if (rest < r) |
460 | r = rest; | 461 | r = rest; |