aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/via82xx_modem.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/via82xx_modem.c')
-rw-r--r--sound/pci/via82xx_modem.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sound/pci/via82xx_modem.c b/sound/pci/via82xx_modem.c
index 31f64ee39882..5bd79d2a5a15 100644
--- a/sound/pci/via82xx_modem.c
+++ b/sound/pci/via82xx_modem.c
@@ -281,7 +281,6 @@ static int build_via_table(struct viadev *dev, struct snd_pcm_substream *substre
281{ 281{
282 unsigned int i, idx, ofs, rest; 282 unsigned int i, idx, ofs, rest;
283 struct via82xx_modem *chip = snd_pcm_substream_chip(substream); 283 struct via82xx_modem *chip = snd_pcm_substream_chip(substream);
284 struct snd_sg_buf *sgbuf = snd_pcm_substream_sgbuf(substream);
285 284
286 if (dev->table.area == NULL) { 285 if (dev->table.area == NULL) {
287 /* the start of each lists must be aligned to 8 bytes, 286 /* the start of each lists must be aligned to 8 bytes,
@@ -310,12 +309,14 @@ static int build_via_table(struct viadev *dev, struct snd_pcm_substream *substre
310 do { 309 do {
311 unsigned int r; 310 unsigned int r;
312 unsigned int flag; 311 unsigned int flag;
312 unsigned int addr;
313 313
314 if (idx >= VIA_TABLE_SIZE) { 314 if (idx >= VIA_TABLE_SIZE) {
315 snd_printk(KERN_ERR "via82xx: too much table size!\n"); 315 snd_printk(KERN_ERR "via82xx: too much table size!\n");
316 return -EINVAL; 316 return -EINVAL;
317 } 317 }
318 ((u32 *)dev->table.area)[idx << 1] = cpu_to_le32((u32)snd_pcm_sgbuf_get_addr(sgbuf, ofs)); 318 addr = snd_pcm_sgbuf_get_addr(substream, ofs);
319 ((u32 *)dev->table.area)[idx << 1] = cpu_to_le32(addr);
319 r = PAGE_SIZE - (ofs % PAGE_SIZE); 320 r = PAGE_SIZE - (ofs % PAGE_SIZE);
320 if (rest < r) 321 if (rest < r)
321 r = rest; 322 r = rest;
@@ -612,7 +613,8 @@ static snd_pcm_uframes_t snd_via686_pcm_pointer(struct snd_pcm_substream *substr
612 struct viadev *viadev = substream->runtime->private_data; 613 struct viadev *viadev = substream->runtime->private_data;
613 unsigned int idx, ptr, count, res; 614 unsigned int idx, ptr, count, res;
614 615
615 snd_assert(viadev->tbl_entries, return 0); 616 if (snd_BUG_ON(!viadev->tbl_entries))
617 return 0;
616 if (!(inb(VIADEV_REG(viadev, OFFSET_STATUS)) & VIA_REG_STAT_ACTIVE)) 618 if (!(inb(VIADEV_REG(viadev, OFFSET_STATUS)) & VIA_REG_STAT_ACTIVE))
617 return 0; 619 return 0;
618 620