diff options
| -rw-r--r-- | sound/pci/ctxfi/ctatc.c | 4 | ||||
| -rw-r--r-- | sound/pci/ctxfi/ctpcm.c | 16 |
2 files changed, 17 insertions, 3 deletions
diff --git a/sound/pci/ctxfi/ctatc.c b/sound/pci/ctxfi/ctatc.c index e54006ef83cf..80fb2baed7a7 100644 --- a/sound/pci/ctxfi/ctatc.c +++ b/sound/pci/ctxfi/ctatc.c | |||
| @@ -523,7 +523,7 @@ atc_pcm_capture_get_resources(struct ct_atc *atc, struct ct_atc_pcm *apcm) | |||
| 523 | struct src_node_conf_t src_node_conf[2] = {{0} }; | 523 | struct src_node_conf_t src_node_conf[2] = {{0} }; |
| 524 | 524 | ||
| 525 | /* first release old resources */ | 525 | /* first release old resources */ |
| 526 | atc->pcm_release_resources(atc, apcm); | 526 | atc_pcm_release_resources(atc, apcm); |
| 527 | 527 | ||
| 528 | /* The numbers of converting SRCs and SRCIMPs should be determined | 528 | /* The numbers of converting SRCs and SRCIMPs should be determined |
| 529 | * by pitch value. */ | 529 | * by pitch value. */ |
| @@ -802,7 +802,7 @@ static int spdif_passthru_playback_get_resources(struct ct_atc *atc, | |||
| 802 | unsigned int pitch, rsr = atc->pll_rate; | 802 | unsigned int pitch, rsr = atc->pll_rate; |
| 803 | 803 | ||
| 804 | /* first release old resources */ | 804 | /* first release old resources */ |
| 805 | atc->pcm_release_resources(atc, apcm); | 805 | atc_pcm_release_resources(atc, apcm); |
| 806 | 806 | ||
| 807 | /* Get SRC resource */ | 807 | /* Get SRC resource */ |
| 808 | desc.multi = apcm->substream->runtime->channels; | 808 | desc.multi = apcm->substream->runtime->channels; |
diff --git a/sound/pci/ctxfi/ctpcm.c b/sound/pci/ctxfi/ctpcm.c index 870fa170f046..9e5c0c4da726 100644 --- a/sound/pci/ctxfi/ctpcm.c +++ b/sound/pci/ctxfi/ctpcm.c | |||
| @@ -176,12 +176,26 @@ static int ct_pcm_playback_close(struct snd_pcm_substream *substream) | |||
| 176 | static int ct_pcm_hw_params(struct snd_pcm_substream *substream, | 176 | static int ct_pcm_hw_params(struct snd_pcm_substream *substream, |
| 177 | struct snd_pcm_hw_params *hw_params) | 177 | struct snd_pcm_hw_params *hw_params) |
| 178 | { | 178 | { |
| 179 | return snd_pcm_lib_malloc_pages(substream, | 179 | struct ct_atc *atc = snd_pcm_substream_chip(substream); |
| 180 | struct ct_atc_pcm *apcm = substream->runtime->private_data; | ||
| 181 | int err; | ||
| 182 | |||
| 183 | err = snd_pcm_lib_malloc_pages(substream, | ||
| 180 | params_buffer_bytes(hw_params)); | 184 | params_buffer_bytes(hw_params)); |
| 185 | if (err < 0) | ||
| 186 | return err; | ||
| 187 | /* clear previous resources */ | ||
| 188 | atc->pcm_release_resources(atc, apcm); | ||
| 189 | return err; | ||
| 181 | } | 190 | } |
| 182 | 191 | ||
| 183 | static int ct_pcm_hw_free(struct snd_pcm_substream *substream) | 192 | static int ct_pcm_hw_free(struct snd_pcm_substream *substream) |
| 184 | { | 193 | { |
| 194 | struct ct_atc *atc = snd_pcm_substream_chip(substream); | ||
| 195 | struct ct_atc_pcm *apcm = substream->runtime->private_data; | ||
| 196 | |||
| 197 | /* clear previous resources */ | ||
| 198 | atc->pcm_release_resources(atc, apcm); | ||
| 185 | /* Free snd-allocated pages */ | 199 | /* Free snd-allocated pages */ |
| 186 | return snd_pcm_lib_free_pages(substream); | 200 | return snd_pcm_lib_free_pages(substream); |
| 187 | } | 201 | } |
