forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/sound/usb/line6/pcm.c
....@@ -1,12 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Line 6 Linux USB driver
34 *
45 * Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
5
- *
6
- * This program is free software; you can redistribute it and/or
7
- * modify it under the terms of the GNU General Public License as
8
- * published by the Free Software Foundation, version 2.
9
- *
106 */
117
128 #include <linux/slab.h>
....@@ -363,13 +359,6 @@
363359 if (ret < 0)
364360 goto error;
365361
366
- ret = snd_pcm_lib_malloc_pages(substream,
367
- params_buffer_bytes(hw_params));
368
- if (ret < 0) {
369
- line6_buffer_release(line6pcm, pstr, LINE6_STREAM_PCM);
370
- goto error;
371
- }
372
-
373362 pstr->period = params_period_bytes(hw_params);
374363 error:
375364 mutex_unlock(&line6pcm->state_mutex);
....@@ -385,7 +374,7 @@
385374 mutex_lock(&line6pcm->state_mutex);
386375 line6_buffer_release(line6pcm, pstr, LINE6_STREAM_PCM);
387376 mutex_unlock(&line6pcm->state_mutex);
388
- return snd_pcm_lib_free_pages(substream);
377
+ return 0;
389378 }
390379
391380
....@@ -505,10 +494,8 @@
505494 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_line6_capture_ops);
506495
507496 /* pre-allocation of buffers */
508
- snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_CONTINUOUS,
509
- snd_dma_continuous_data
510
- (GFP_KERNEL), 64 * 1024,
511
- 128 * 1024);
497
+ snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_CONTINUOUS,
498
+ NULL, 64 * 1024, 128 * 1024);
512499 return 0;
513500 }
514501