Commit 4d1b5303 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ALSA: usb: Drop superfluous PCM preallocation error checks



snd_pcm_lib_preallocate_pages() and co always succeed, so the error
check is simply redundant.  Drop it.

Reviewed-by: default avatarJaroslav Kysela <perex@perex.cz>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 600bacfc
Loading
Loading
Loading
Loading
+10 −11
Original line number Diff line number Diff line
@@ -981,18 +981,17 @@ static int usX2Y_audio_stream_new(struct snd_card *card, int playback_endpoint,

	sprintf(pcm->name, NAME_ALLCAPS" Audio #%d", usX2Y(card)->pcm_devs);

	if ((playback_endpoint &&
	     0 > (err = snd_pcm_lib_preallocate_pages(pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream,
	if (playback_endpoint) {
		snd_pcm_lib_preallocate_pages(pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream,
					      SNDRV_DMA_TYPE_CONTINUOUS,
					      snd_dma_continuous_data(GFP_KERNEL),
						     64*1024, 128*1024))) ||
	    0 > (err = snd_pcm_lib_preallocate_pages(pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream,
					      64*1024, 128*1024);
	}

	snd_pcm_lib_preallocate_pages(pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream,
				      SNDRV_DMA_TYPE_CONTINUOUS,
				      snd_dma_continuous_data(GFP_KERNEL),
						     64*1024, 128*1024))) {
		snd_usX2Y_pcm_private_free(pcm);
		return err;
	}
				      64*1024, 128*1024);
	usX2Y(card)->pcm_devs++;

	return 0;
+8 −11
Original line number Diff line number Diff line
@@ -736,17 +736,14 @@ int usX2Y_hwdep_pcm_new(struct snd_card *card)
	pcm->info_flags = 0;

	sprintf(pcm->name, NAME_ALLCAPS" hwdep Audio");
	if (0 > (err = snd_pcm_lib_preallocate_pages(pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream,
	snd_pcm_lib_preallocate_pages(pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream,
				      SNDRV_DMA_TYPE_CONTINUOUS,
				      snd_dma_continuous_data(GFP_KERNEL),
						     64*1024, 128*1024)) ||
	    0 > (err = snd_pcm_lib_preallocate_pages(pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream,
				      64*1024, 128*1024);
	snd_pcm_lib_preallocate_pages(pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream,
				      SNDRV_DMA_TYPE_CONTINUOUS,
				      snd_dma_continuous_data(GFP_KERNEL),
						     64*1024, 128*1024))) {
		return err;
	}

				      64*1024, 128*1024);

	return 0;
}