diff options
Diffstat (limited to 'sound/pci/ctxfi/ctpcm.c')
-rw-r--r-- | sound/pci/ctxfi/ctpcm.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/sound/pci/ctxfi/ctpcm.c b/sound/pci/ctxfi/ctpcm.c index 85ab43e89212..457d21189b0d 100644 --- a/sound/pci/ctxfi/ctpcm.c +++ b/sound/pci/ctxfi/ctpcm.c | |||
@@ -129,8 +129,6 @@ static int ct_pcm_playback_open(struct snd_pcm_substream *substream) | |||
129 | 129 | ||
130 | apcm->substream = substream; | 130 | apcm->substream = substream; |
131 | apcm->interrupt = ct_atc_pcm_interrupt; | 131 | apcm->interrupt = ct_atc_pcm_interrupt; |
132 | runtime->private_data = apcm; | ||
133 | runtime->private_free = ct_atc_pcm_free_substream; | ||
134 | if (IEC958 == substream->pcm->device) { | 132 | if (IEC958 == substream->pcm->device) { |
135 | runtime->hw = ct_spdif_passthru_playback_hw; | 133 | runtime->hw = ct_spdif_passthru_playback_hw; |
136 | atc->spdif_out_passthru(atc, 1); | 134 | atc->spdif_out_passthru(atc, 1); |
@@ -155,8 +153,12 @@ static int ct_pcm_playback_open(struct snd_pcm_substream *substream) | |||
155 | } | 153 | } |
156 | 154 | ||
157 | apcm->timer = ct_timer_instance_new(atc->timer, apcm); | 155 | apcm->timer = ct_timer_instance_new(atc->timer, apcm); |
158 | if (!apcm->timer) | 156 | if (!apcm->timer) { |
157 | kfree(apcm); | ||
159 | return -ENOMEM; | 158 | return -ENOMEM; |
159 | } | ||
160 | runtime->private_data = apcm; | ||
161 | runtime->private_free = ct_atc_pcm_free_substream; | ||
160 | 162 | ||
161 | return 0; | 163 | return 0; |
162 | } | 164 | } |
@@ -278,8 +280,6 @@ static int ct_pcm_capture_open(struct snd_pcm_substream *substream) | |||
278 | apcm->started = 0; | 280 | apcm->started = 0; |
279 | apcm->substream = substream; | 281 | apcm->substream = substream; |
280 | apcm->interrupt = ct_atc_pcm_interrupt; | 282 | apcm->interrupt = ct_atc_pcm_interrupt; |
281 | runtime->private_data = apcm; | ||
282 | runtime->private_free = ct_atc_pcm_free_substream; | ||
283 | runtime->hw = ct_pcm_capture_hw; | 283 | runtime->hw = ct_pcm_capture_hw; |
284 | runtime->hw.rate_max = atc->rsr * atc->msr; | 284 | runtime->hw.rate_max = atc->rsr * atc->msr; |
285 | 285 | ||
@@ -298,8 +298,12 @@ static int ct_pcm_capture_open(struct snd_pcm_substream *substream) | |||
298 | } | 298 | } |
299 | 299 | ||
300 | apcm->timer = ct_timer_instance_new(atc->timer, apcm); | 300 | apcm->timer = ct_timer_instance_new(atc->timer, apcm); |
301 | if (!apcm->timer) | 301 | if (!apcm->timer) { |
302 | kfree(apcm); | ||
302 | return -ENOMEM; | 303 | return -ENOMEM; |
304 | } | ||
305 | runtime->private_data = apcm; | ||
306 | runtime->private_free = ct_atc_pcm_free_substream; | ||
303 | 307 | ||
304 | return 0; | 308 | return 0; |
305 | } | 309 | } |