]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - sound/drivers/ml403-ac97cr.c
Merge tag 'selinux-pr-20200210' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux.git] / sound / drivers / ml403-ac97cr.c
index 70a6d1832698f9b2cfe20e0cf73f9a631e4e2639..0710707da8c1ebf60b29f8872a6cb4913d91b720 100644 (file)
@@ -670,23 +670,6 @@ snd_ml403_ac97cr_pcm_capture_prepare(struct snd_pcm_substream *substream)
        return 0;
 }
 
-static int snd_ml403_ac97cr_hw_free(struct snd_pcm_substream *substream)
-{
-       PDEBUG(WORK_INFO, "hw_free()\n");
-       return snd_pcm_lib_free_pages(substream);
-}
-
-static int
-snd_ml403_ac97cr_hw_params(struct snd_pcm_substream *substream,
-                          struct snd_pcm_hw_params *hw_params)
-{
-       PDEBUG(WORK_INFO, "hw_params(): desired buffer bytes=%d, desired "
-              "period bytes=%d\n",
-              params_buffer_bytes(hw_params), params_period_bytes(hw_params));
-       return snd_pcm_lib_malloc_pages(substream,
-                                       params_buffer_bytes(hw_params));
-}
-
 static int snd_ml403_ac97cr_playback_open(struct snd_pcm_substream *substream)
 {
        struct snd_ml403_ac97cr *ml403_ac97cr;
@@ -748,9 +731,6 @@ static int snd_ml403_ac97cr_capture_close(struct snd_pcm_substream *substream)
 static const struct snd_pcm_ops snd_ml403_ac97cr_playback_ops = {
        .open = snd_ml403_ac97cr_playback_open,
        .close = snd_ml403_ac97cr_playback_close,
-       .ioctl = snd_pcm_lib_ioctl,
-       .hw_params = snd_ml403_ac97cr_hw_params,
-       .hw_free = snd_ml403_ac97cr_hw_free,
        .prepare = snd_ml403_ac97cr_pcm_playback_prepare,
        .trigger = snd_ml403_ac97cr_pcm_playback_trigger,
        .pointer = snd_ml403_ac97cr_pcm_pointer,
@@ -759,9 +739,6 @@ static const struct snd_pcm_ops snd_ml403_ac97cr_playback_ops = {
 static const struct snd_pcm_ops snd_ml403_ac97cr_capture_ops = {
        .open = snd_ml403_ac97cr_capture_open,
        .close = snd_ml403_ac97cr_capture_close,
-       .ioctl = snd_pcm_lib_ioctl,
-       .hw_params = snd_ml403_ac97cr_hw_params,
-       .hw_free = snd_ml403_ac97cr_hw_free,
        .prepare = snd_ml403_ac97cr_pcm_capture_prepare,
        .trigger = snd_ml403_ac97cr_pcm_capture_trigger,
        .pointer = snd_ml403_ac97cr_pcm_pointer,
@@ -1099,7 +1076,7 @@ snd_ml403_ac97cr_create(struct snd_card *card, struct platform_device *pfdev,
 {
        struct snd_ml403_ac97cr *ml403_ac97cr;
        int err;
-       static struct snd_device_ops ops = {
+       static const struct snd_device_ops ops = {
                .dev_free = snd_ml403_ac97cr_dev_free,
        };
        struct resource *resource;
@@ -1123,7 +1100,7 @@ snd_ml403_ac97cr_create(struct snd_card *card, struct platform_device *pfdev,
        PDEBUG(INIT_INFO, "Trying to reserve resources now ...\n");
        resource = platform_get_resource(pfdev, IORESOURCE_MEM, 0);
        /* get "port" */
-       ml403_ac97cr->port = ioremap_nocache(resource->start,
+       ml403_ac97cr->port = ioremap(resource->start,
                                             (resource->end) -
                                             (resource->start) + 1);
        if (ml403_ac97cr->port == NULL) {
@@ -1195,7 +1172,7 @@ snd_ml403_ac97cr_mixer(struct snd_ml403_ac97cr *ml403_ac97cr)
        struct snd_ac97_bus *bus;
        struct snd_ac97_template ac97;
        int err;
-       static struct snd_ac97_bus_ops ops = {
+       static const struct snd_ac97_bus_ops ops = {
                .write = snd_ml403_ac97cr_codec_write,
                .read = snd_ml403_ac97cr_codec_read,
        };
@@ -1241,10 +1218,10 @@ snd_ml403_ac97cr_pcm(struct snd_ml403_ac97cr *ml403_ac97cr, int device)
        strcpy(pcm->name, "ML403AC97CR DAC/ADC");
        ml403_ac97cr->pcm = pcm;
 
-       snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_CONTINUOUS,
-                                         NULL,
-                                         64 * 1024,
-                                         128 * 1024);
+       snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_CONTINUOUS,
+                                      NULL,
+                                      64 * 1024,
+                                      128 * 1024);
        return 0;
 }