| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Line 6 Linux USB driver |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * 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 | | - * |
|---|
| 10 | 6 | */ |
|---|
| 11 | 7 | |
|---|
| 12 | 8 | #include <linux/slab.h> |
|---|
| .. | .. |
|---|
| 363 | 359 | if (ret < 0) |
|---|
| 364 | 360 | goto error; |
|---|
| 365 | 361 | |
|---|
| 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 | | - |
|---|
| 373 | 362 | pstr->period = params_period_bytes(hw_params); |
|---|
| 374 | 363 | error: |
|---|
| 375 | 364 | mutex_unlock(&line6pcm->state_mutex); |
|---|
| .. | .. |
|---|
| 385 | 374 | mutex_lock(&line6pcm->state_mutex); |
|---|
| 386 | 375 | line6_buffer_release(line6pcm, pstr, LINE6_STREAM_PCM); |
|---|
| 387 | 376 | mutex_unlock(&line6pcm->state_mutex); |
|---|
| 388 | | - return snd_pcm_lib_free_pages(substream); |
|---|
| 377 | + return 0; |
|---|
| 389 | 378 | } |
|---|
| 390 | 379 | |
|---|
| 391 | 380 | |
|---|
| .. | .. |
|---|
| 505 | 494 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_line6_capture_ops); |
|---|
| 506 | 495 | |
|---|
| 507 | 496 | /* 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); |
|---|
| 512 | 499 | return 0; |
|---|
| 513 | 500 | } |
|---|
| 514 | 501 | |
|---|