hc
2024-01-04 1543e317f1da31b75942316931e8f491a8920811
kernel/sound/sparc/amd7930.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Driver for AMD7930 sound chips found on Sparcs.
34 * Copyright (C) 2002, 2008 David S. Miller <davem@davemloft.net>
....@@ -722,23 +723,9 @@
722723 return 0;
723724 }
724725
725
-static int snd_amd7930_hw_params(struct snd_pcm_substream *substream,
726
- struct snd_pcm_hw_params *hw_params)
727
-{
728
- return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
729
-}
730
-
731
-static int snd_amd7930_hw_free(struct snd_pcm_substream *substream)
732
-{
733
- return snd_pcm_lib_free_pages(substream);
734
-}
735
-
736726 static const struct snd_pcm_ops snd_amd7930_playback_ops = {
737727 .open = snd_amd7930_playback_open,
738728 .close = snd_amd7930_playback_close,
739
- .ioctl = snd_pcm_lib_ioctl,
740
- .hw_params = snd_amd7930_hw_params,
741
- .hw_free = snd_amd7930_hw_free,
742729 .prepare = snd_amd7930_playback_prepare,
743730 .trigger = snd_amd7930_playback_trigger,
744731 .pointer = snd_amd7930_playback_pointer,
....@@ -747,9 +734,6 @@
747734 static const struct snd_pcm_ops snd_amd7930_capture_ops = {
748735 .open = snd_amd7930_capture_open,
749736 .close = snd_amd7930_capture_close,
750
- .ioctl = snd_pcm_lib_ioctl,
751
- .hw_params = snd_amd7930_hw_params,
752
- .hw_free = snd_amd7930_hw_free,
753737 .prepare = snd_amd7930_capture_prepare,
754738 .trigger = snd_amd7930_capture_trigger,
755739 .pointer = snd_amd7930_capture_pointer,
....@@ -775,9 +759,8 @@
775759 strcpy(pcm->name, amd->card->shortname);
776760 amd->pcm = pcm;
777761
778
- snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_CONTINUOUS,
779
- snd_dma_continuous_data(GFP_KERNEL),
780
- 64*1024, 64*1024);
762
+ snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_CONTINUOUS,
763
+ NULL, 64*1024, 64*1024);
781764
782765 return 0;
783766 }
....@@ -854,7 +837,7 @@
854837 return change;
855838 }
856839
857
-static struct snd_kcontrol_new amd7930_controls[] = {
840
+static const struct snd_kcontrol_new amd7930_controls[] = {
858841 {
859842 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
860843 .name = "Monitor Volume",
....@@ -929,7 +912,7 @@
929912 return snd_amd7930_free(amd);
930913 }
931914
932
-static struct snd_device_ops snd_amd7930_dev_ops = {
915
+static const struct snd_device_ops snd_amd7930_dev_ops = {
933916 .dev_free = snd_amd7930_dev_free,
934917 };
935918