aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx/em28xx-audio.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2008-11-07 12:24:18 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-29 14:53:28 -0500
commit1f6340bd431921f9b6dc995973eb065d6c14f024 (patch)
tree36097e8ce3f0cf95729008bb1ffd51c5ce7c5f4b /drivers/media/video/em28xx/em28xx-audio.c
parent886134e4be4e9ef585b0ecde5eebcaf37ee78f80 (diff)
V4L/DVB (9532): Properly handle error messages during alsa registering
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-audio.c')
-rw-r--r--drivers/media/video/em28xx/em28xx-audio.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/media/video/em28xx/em28xx-audio.c b/drivers/media/video/em28xx/em28xx-audio.c
index 7a8d49ef646e..215ee789f107 100644
--- a/drivers/media/video/em28xx/em28xx-audio.c
+++ b/drivers/media/video/em28xx/em28xx-audio.c
@@ -428,7 +428,7 @@ static int em28xx_audio_init(struct em28xx *dev)
428 428
429 if (dev->has_audio_class) { 429 if (dev->has_audio_class) {
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) */
432 return 0; 432 return 0;
433 } 433 }
434 434
@@ -449,7 +449,12 @@ static int em28xx_audio_init(struct em28xx *dev)
449 } 449 }
450 450
451 spin_lock_init(&adev->slock); 451 spin_lock_init(&adev->slock);
452 ret = snd_pcm_new(card, "Em28xx Audio", 0, 0, 1, &pcm); 452 err = snd_pcm_new(card, "Em28xx Audio", 0, 0, 1, &pcm);
453 if (err < 0) {
454 snd_card_free(card);
455 return err;
456 }
457
453 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_em28xx_pcm_capture); 458 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_em28xx_pcm_capture);
454 pcm->info_flags = 0; 459 pcm->info_flags = 0;
455 pcm->private_data = dev; 460 pcm->private_data = dev;
@@ -461,7 +466,7 @@ static int em28xx_audio_init(struct em28xx *dev)
461 err = snd_card_register(card); 466 err = snd_card_register(card);
462 if (err < 0) { 467 if (err < 0) {
463 snd_card_free(card); 468 snd_card_free(card);
464 return -ENOMEM; 469 return err;
465 } 470 }
466 adev->sndcard = card; 471 adev->sndcard = card;
467 adev->udev = dev->udev; 472 adev->udev = dev->udev;