Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1f6340bd authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

V4L/DVB (9532): Properly handle error messages during alsa registering

parent 886134e4
Loading
Loading
Loading
Loading
+8 −3
Original line number Original line Diff line number Diff line
@@ -428,7 +428,7 @@ static int em28xx_audio_init(struct em28xx *dev)


	if (dev->has_audio_class) {
	if (dev->has_audio_class) {
		/* This device does not support the extension (in this case
		/* This device does not support the extension (in this case
		   the device is expecting the snd-usb-audio module */
		   the device is expecting the snd-usb-audio module) */
		return 0;
		return 0;
	}
	}


@@ -449,7 +449,12 @@ static int em28xx_audio_init(struct em28xx *dev)
	}
	}


	spin_lock_init(&adev->slock);
	spin_lock_init(&adev->slock);
	ret = snd_pcm_new(card, "Em28xx Audio", 0, 0, 1, &pcm);
	err = snd_pcm_new(card, "Em28xx Audio", 0, 0, 1, &pcm);
	if (err < 0) {
		snd_card_free(card);
		return err;
	}

	snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_em28xx_pcm_capture);
	snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_em28xx_pcm_capture);
	pcm->info_flags = 0;
	pcm->info_flags = 0;
	pcm->private_data = dev;
	pcm->private_data = dev;
@@ -461,7 +466,7 @@ static int em28xx_audio_init(struct em28xx *dev)
	err = snd_card_register(card);
	err = snd_card_register(card);
	if (err < 0) {
	if (err < 0) {
		snd_card_free(card);
		snd_card_free(card);
		return -ENOMEM;
		return err;
	}
	}
	adev->sndcard = card;
	adev->sndcard = card;
	adev->udev = dev->udev;
	adev->udev = dev->udev;