Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 137871
b: refs/heads/master
c: aa5a182
h: refs/heads/master
i:
  137869: 911f200
  137867: b017e97
  137863: d3ac8ba
  137855: 26be452
v: v3
  • Loading branch information
Robert Krakora authored and Mauro Carvalho Chehab committed Mar 30, 2009
1 parent ae750a4 commit 1030877
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3e099baff451affd13a93c6fed216943e01b80fd
refs/heads/master: aa5a1821859c9c2915bc00e79f6e01e619df6e8f
22 changes: 18 additions & 4 deletions trunk/drivers/media/video/em28xx/em28xx-audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ MODULE_PARM_DESC(debug, "activates debug info");

static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;

static int em28xx_isoc_audio_deinit(struct em28xx *dev)
static int em28xx_deinit_isoc_audio(struct em28xx *dev)
{
int i;

Expand All @@ -66,6 +66,7 @@ static int em28xx_isoc_audio_deinit(struct em28xx *dev)
usb_kill_urb(dev->adev.urb[i]);
else
usb_unlink_urb(dev->adev.urb[i]);

usb_free_urb(dev->adev.urb[i]);
dev->adev.urb[i] = NULL;

Expand All @@ -87,6 +88,20 @@ static void em28xx_audio_isocirq(struct urb *urb)
unsigned int stride;
struct snd_pcm_substream *substream;
struct snd_pcm_runtime *runtime;

switch (urb->status) {
case 0: /* success */
case -ETIMEDOUT: /* NAK */
break;
case -ECONNRESET: /* kill */
case -ENOENT:
case -ESHUTDOWN:
return;
default: /* error */
dprintk("urb completition error %d.\n", urb->status);
break;
}

if (dev->adev.capture_pcm_substream) {
substream = dev->adev.capture_pcm_substream;
runtime = substream->runtime;
Expand Down Expand Up @@ -197,8 +212,7 @@ static int em28xx_init_audio_isoc(struct em28xx *dev)
for (i = 0; i < EM28XX_AUDIO_BUFS; i++) {
errCode = usb_submit_urb(dev->adev.urb[i], GFP_ATOMIC);
if (errCode) {
em28xx_isoc_audio_deinit(dev);

em28xx_deinit_isoc_audio(dev);
return errCode;
}
}
Expand All @@ -218,7 +232,7 @@ static int em28xx_cmd(struct em28xx *dev, int cmd, int arg)
em28xx_init_audio_isoc(dev);
} else if (dev->adev.capture_stream == STREAM_ON && arg == 0) {
dev->adev.capture_stream = STREAM_OFF;
em28xx_isoc_audio_deinit(dev);
em28xx_deinit_isoc_audio(dev);
} else {
printk(KERN_ERR "An underrun very likely occurred. "
"Ignoring it.\n");
Expand Down
13 changes: 13 additions & 0 deletions trunk/drivers/media/video/em28xx/em28xx-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,19 @@ static void em28xx_irq_callback(struct urb *urb)
struct em28xx *dev = container_of(dma_q, struct em28xx, vidq);
int rc, i;

switch (urb->status) {
case 0: /* success */
case -ETIMEDOUT: /* NAK */
break;
case -ECONNRESET: /* kill */
case -ENOENT:
case -ESHUTDOWN:
return;
default: /* error */
em28xx_isocdbg("urb completition error %d.\n", urb->status);
break;
}

/* Copy data from URB */
spin_lock(&dev->slock);
rc = dev->isoc_ctl.isoc_copy(dev, urb);
Expand Down

0 comments on commit 1030877

Please sign in to comment.