pm_qos: Get rid of the allocation in pm_qos_add_request()
[deliverable/linux.git] / sound / core / pcm_native.c
index 303ac04ff6e427066bf95fe0932361efd7a94ea3..a3b2a6479246deca30152bbb7f84e049634f2662 100644 (file)
@@ -451,13 +451,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;
 
-       if (substream->latency_pm_qos_req) {
-               pm_qos_remove_request(substream->latency_pm_qos_req);
-               substream->latency_pm_qos_req = NULL;
-       }
+       if (pm_qos_request_active(&substream->latency_pm_qos_req))
+               pm_qos_remove_request(&substream->latency_pm_qos_req);
        if ((usecs = period_to_usecs(runtime)) >= 0)
-               substream->latency_pm_qos_req = pm_qos_add_request(
-                                       PM_QOS_CPU_DMA_LATENCY, usecs);
+               pm_qos_add_request(&substream->latency_pm_qos_req,
+                                  PM_QOS_CPU_DMA_LATENCY, usecs);
        return 0;
  _error:
        /* hardware might be unuseable from this time,
@@ -512,8 +510,7 @@ 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;
-       pm_qos_remove_request(substream->latency_pm_qos_req);
-       substream->latency_pm_qos_req = NULL;
+       pm_qos_remove_request(&substream->latency_pm_qos_req);
        return result;
 }
 
This page took 0.034972 seconds and 5 git commands to generate.