X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=sound%2Fcore%2Fpcm_native.c;h=c49b9d9e303c76d6495943b5b99fb02eff710e1f;hb=bacac545f10f2bf6e5ceff0d8e2b82dfc493602a;hp=62449117ee14f6a13cc0f76d5bba6624df3596b9;hpb=8c12158687fc78091730d5456336b7efbf6f2250;p=safe%2Fjmp%2Flinux-2.6 diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 6244911..c49b9d9 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -22,8 +22,9 @@ #include #include #include +#include #include -#include +#include #include #include #include @@ -443,9 +444,11 @@ static int snd_pcm_hw_params(struct snd_pcm_substream *substream, snd_pcm_timer_resolution_change(substream); runtime->status->state = SNDRV_PCM_STATE_SETUP; - remove_acceptable_latency(substream->latency_id); + pm_qos_remove_requirement(PM_QOS_CPU_DMA_LATENCY, + substream->latency_id); if ((usecs = period_to_usecs(runtime)) >= 0) - set_acceptable_latency(substream->latency_id, usecs); + pm_qos_add_requirement(PM_QOS_CPU_DMA_LATENCY, + substream->latency_id, usecs); return 0; _error: /* hardware might be unuseable from this time, @@ -505,7 +508,8 @@ static int snd_pcm_hw_free(struct snd_pcm_substream *substream) if (substream->ops->hw_free) result = substream->ops->hw_free(substream); runtime->status->state = SNDRV_PCM_STATE_OPEN; - remove_acceptable_latency(substream->latency_id); + pm_qos_remove_requirement(PM_QOS_CPU_DMA_LATENCY, + substream->latency_id); return result; } @@ -3246,14 +3250,17 @@ static int snd_pcm_fasync(int fd, struct file * file, int on) struct snd_pcm_file * pcm_file; struct snd_pcm_substream *substream; struct snd_pcm_runtime *runtime; - int err; + int err = -ENXIO; + lock_kernel(); pcm_file = file->private_data; substream = pcm_file->substream; - snd_assert(substream != NULL, return -ENXIO); + snd_assert(substream != NULL, goto out); runtime = substream->runtime; err = fasync_helper(fd, file, on, &runtime->fasync); +out: + unlock_kernel(); if (err < 0) return err; return 0;