Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

staging: bcm2835-audio: Use managed buffer allocation

Clean up the driver with the new managed buffer allocation API.
The hw_params and hw_free callbacks became superfluous and dropped.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20191210141356.18074-3-tiwai@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Takashi Iwai and committed by
Greg Kroah-Hartman
3ad10e57 7e6d24d9

+1 -16
+1 -16
drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c
··· 193 193 return 0; 194 194 } 195 195 196 - static int snd_bcm2835_pcm_hw_params(struct snd_pcm_substream *substream, 197 - struct snd_pcm_hw_params *params) 198 - { 199 - return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params)); 200 - } 201 - 202 - static int snd_bcm2835_pcm_hw_free(struct snd_pcm_substream *substream) 203 - { 204 - return snd_pcm_lib_free_pages(substream); 205 - } 206 - 207 196 static int snd_bcm2835_pcm_prepare(struct snd_pcm_substream *substream) 208 197 { 209 198 struct bcm2835_chip *chip = snd_pcm_substream_chip(substream); ··· 306 317 .open = snd_bcm2835_playback_open, 307 318 .close = snd_bcm2835_playback_close, 308 319 .ioctl = snd_pcm_lib_ioctl, 309 - .hw_params = snd_bcm2835_pcm_hw_params, 310 - .hw_free = snd_bcm2835_pcm_hw_free, 311 320 .prepare = snd_bcm2835_pcm_prepare, 312 321 .trigger = snd_bcm2835_pcm_trigger, 313 322 .pointer = snd_bcm2835_pcm_pointer, ··· 316 329 .open = snd_bcm2835_playback_spdif_open, 317 330 .close = snd_bcm2835_playback_close, 318 331 .ioctl = snd_pcm_lib_ioctl, 319 - .hw_params = snd_bcm2835_pcm_hw_params, 320 - .hw_free = snd_bcm2835_pcm_hw_free, 321 332 .prepare = snd_bcm2835_pcm_prepare, 322 333 .trigger = snd_bcm2835_pcm_trigger, 323 334 .pointer = snd_bcm2835_pcm_pointer, ··· 347 362 spdif ? &snd_bcm2835_playback_spdif_ops : 348 363 &snd_bcm2835_playback_ops); 349 364 350 - snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, 365 + snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV, 351 366 chip->card->dev, 128 * 1024, 128 * 1024); 352 367 353 368 if (spdif)