Commit 36e4617c authored by Takashi Iwai's avatar Takashi Iwai
Browse files

Merge branch 'topic/memory-device-fixes-2' into for-next



Pull further device memory allocation cleanups (but no API change yet).

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parents 0b2338a9 62e94da3
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -360,13 +360,11 @@ static int solo_snd_pcm_init(struct solo_dev *solo_dev)
	     ss; ss = ss->next, i++)
		sprintf(ss->name, "Camera #%d Audio", i);

	ret = snd_pcm_lib_preallocate_pages_for_all(pcm,
	snd_pcm_lib_preallocate_pages_for_all(pcm,
					SNDRV_DMA_TYPE_CONTINUOUS,
					snd_dma_continuous_data(GFP_KERNEL),
					G723_PERIOD_BYTES * PERIODS,
					G723_PERIOD_BYTES * PERIODS);
	if (ret < 0)
		return ret;

	solo_dev->snd_pcm = pcm;

+2 −1
Original line number Diff line number Diff line
@@ -301,11 +301,12 @@ static int tw686x_snd_pcm_init(struct tw686x_dev *dev)
	     ss; ss = ss->next, i++)
		snprintf(ss->name, sizeof(ss->name), "vch%u audio", i);

	return snd_pcm_lib_preallocate_pages_for_all(pcm,
	snd_pcm_lib_preallocate_pages_for_all(pcm,
				SNDRV_DMA_TYPE_DEV,
				snd_dma_pci_data(dev->pci_dev),
				TW686X_AUDIO_PAGE_MAX * AUDIO_DMA_SIZE_MAX,
				TW686X_AUDIO_PAGE_MAX * AUDIO_DMA_SIZE_MAX);
	return 0;
}

static void tw686x_audio_dma_free(struct tw686x_dev *dev,
+1 −3
Original line number Diff line number Diff line
@@ -603,11 +603,9 @@ static int atmel_ac97c_pcm_new(struct atmel_ac97c *chip)
	snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &atmel_ac97_capture_ops);
	snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &atmel_ac97_playback_ops);

	retval = snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
	snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
			&chip->pdev->dev, hw.periods_min * hw.period_bytes_min,
			hw.buffer_bytes_max);
	if (retval)
		return retval;

	pcm->private_data = chip;
	pcm->info_flags = 0;
+2 −8
Original line number Diff line number Diff line
@@ -669,14 +669,8 @@ snd_harmony_pcm_init(struct snd_harmony *h)
	}

	/* pre-allocate space for DMA */
	err = snd_pcm_lib_preallocate_pages_for_all(pcm, h->dma.type,
						    h->dma.dev,
						    MAX_BUF_SIZE, 
						    MAX_BUF_SIZE);
	if (err < 0) {
		printk(KERN_ERR PFX "buffer allocation error: %d\n", err);
		return err;
	}
	snd_pcm_lib_preallocate_pages_for_all(pcm, h->dma.type, h->dma.dev,
					      MAX_BUF_SIZE, MAX_BUF_SIZE);

	h->st.format = snd_harmony_set_data_format(h,
		SNDRV_PCM_FORMAT_S16_BE, 1);
+1 −6
Original line number Diff line number Diff line
@@ -644,16 +644,11 @@ snd_ad1889_pcm_init(struct snd_ad1889 *chip, int device)
	chip->psubs = NULL;
	chip->csubs = NULL;

	err = snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
	snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
						snd_dma_pci_data(chip->pci),
						BUFFER_BYTES_MAX / 2,
						BUFFER_BYTES_MAX);

	if (err < 0) {
		dev_err(chip->card->dev, "buffer allocation error: %d\n", err);
		return err;
	}
	
	return 0;
}

Loading