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

ALSA: mips: Convert to the common vmalloc memalloc

The recent change (*) in the ALSA memalloc core allows us to drop the
special vmalloc-specific allocation and page handling. This patch
coverts to the common code.
(*) 1fe7f397cfe2: ALSA: memalloc: Add vmalloc buffer allocation
support
7e8edae39fd1: ALSA: pcm: Handle special page mapping in the
default mmap handler

Link: https://lore.kernel.org/r/20191105151856.10785-18-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>

+6 -6
+6 -6
sound/mips/sgio2audio.c
··· 582 582 static int snd_sgio2audio_pcm_hw_params(struct snd_pcm_substream *substream, 583 583 struct snd_pcm_hw_params *hw_params) 584 584 { 585 - return snd_pcm_lib_alloc_vmalloc_buffer(substream, 586 - params_buffer_bytes(hw_params)); 585 + return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); 587 586 } 588 587 589 588 /* hw_free callback */ 590 589 static int snd_sgio2audio_pcm_hw_free(struct snd_pcm_substream *substream) 591 590 { 592 - return snd_pcm_lib_free_vmalloc_buffer(substream); 591 + return snd_pcm_lib_free_pages(substream); 593 592 } 594 593 595 594 /* prepare callback */ ··· 669 670 .prepare = snd_sgio2audio_pcm_prepare, 670 671 .trigger = snd_sgio2audio_pcm_trigger, 671 672 .pointer = snd_sgio2audio_pcm_pointer, 672 - .page = snd_pcm_lib_get_vmalloc_page, 673 673 }; 674 674 675 675 static const struct snd_pcm_ops snd_sgio2audio_playback2_ops = { ··· 680 682 .prepare = snd_sgio2audio_pcm_prepare, 681 683 .trigger = snd_sgio2audio_pcm_trigger, 682 684 .pointer = snd_sgio2audio_pcm_pointer, 683 - .page = snd_pcm_lib_get_vmalloc_page, 684 685 }; 685 686 686 687 static const struct snd_pcm_ops snd_sgio2audio_capture_ops = { ··· 691 694 .prepare = snd_sgio2audio_pcm_prepare, 692 695 .trigger = snd_sgio2audio_pcm_trigger, 693 696 .pointer = snd_sgio2audio_pcm_pointer, 694 - .page = snd_pcm_lib_get_vmalloc_page, 695 697 }; 696 698 697 699 /* ··· 716 720 &snd_sgio2audio_playback1_ops); 717 721 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, 718 722 &snd_sgio2audio_capture_ops); 723 + snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_VMALLOC, 724 + NULL, 0, 0); 719 725 720 726 /* create second pcm device with one outputs and no input */ 721 727 err = snd_pcm_new(chip->card, "SGI O2 Audio", 1, 1, 0, &pcm); ··· 730 732 /* set operators */ 731 733 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, 732 734 &snd_sgio2audio_playback2_ops); 735 + snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_VMALLOC, 736 + NULL, 0, 0); 733 737 734 738 return 0; 735 739 }