aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx/em28xx-audio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-audio.c')
-rw-r--r--drivers/media/video/em28xx/em28xx-audio.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/drivers/media/video/em28xx/em28xx-audio.c b/drivers/media/video/em28xx/em28xx-audio.c
index 7a8d49ef646e..15c03f0e69ad 100644
--- a/drivers/media/video/em28xx/em28xx-audio.c
+++ b/drivers/media/video/em28xx/em28xx-audio.c
@@ -424,11 +424,12 @@ static int em28xx_audio_init(struct em28xx *dev)
424 struct snd_pcm *pcm; 424 struct snd_pcm *pcm;
425 struct snd_card *card; 425 struct snd_card *card;
426 static int devnr; 426 static int devnr;
427 int ret, err; 427 int err;
428 428
429 if (dev->has_audio_class) { 429 if (dev->has_alsa_audio != 1) {
430 /* This device does not support the extension (in this case 430 /* This device does not support the extension (in this case
431 the device is expecting the snd-usb-audio module */ 431 the device is expecting the snd-usb-audio module or
432 doesn't have analog audio support at all) */
432 return 0; 433 return 0;
433 } 434 }
434 435
@@ -449,7 +450,12 @@ static int em28xx_audio_init(struct em28xx *dev)
449 } 450 }
450 451
451 spin_lock_init(&adev->slock); 452 spin_lock_init(&adev->slock);
452 ret = snd_pcm_new(card, "Em28xx Audio", 0, 0, 1, &pcm); 453 err = snd_pcm_new(card, "Em28xx Audio", 0, 0, 1, &pcm);
454 if (err < 0) {
455 snd_card_free(card);
456 return err;
457 }
458
453 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_em28xx_pcm_capture); 459 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_em28xx_pcm_capture);
454 pcm->info_flags = 0; 460 pcm->info_flags = 0;
455 pcm->private_data = dev; 461 pcm->private_data = dev;
@@ -461,7 +467,7 @@ static int em28xx_audio_init(struct em28xx *dev)
461 err = snd_card_register(card); 467 err = snd_card_register(card);
462 if (err < 0) { 468 if (err < 0) {
463 snd_card_free(card); 469 snd_card_free(card);
464 return -ENOMEM; 470 return err;
465 } 471 }
466 adev->sndcard = card; 472 adev->sndcard = card;
467 adev->udev = dev->udev; 473 adev->udev = dev->udev;
@@ -475,9 +481,10 @@ static int em28xx_audio_fini(struct em28xx *dev)
475 if (dev == NULL) 481 if (dev == NULL)
476 return 0; 482 return 0;
477 483
478 if (dev->has_audio_class) { 484 if (dev->has_alsa_audio != 1) {
479 /* This device does not support the extension (in this case 485 /* This device does not support the extension (in this case
480 the device is expecting the snd-usb-audio module */ 486 the device is expecting the snd-usb-audio module or
487 doesn't have analog audio support at all) */
481 return 0; 488 return 0;
482 } 489 }
483 490