ASoC: Add check for pm_qos_req before removal

Check if pm_qos_req is active before removal.

Change-Id: I0076a73ffa6310dbb4cb207ca7a651aa1d3fdf04
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
This commit is contained in:
Soumya Managoli 2022-12-12 12:22:23 +05:30 • committed by Gerrit - the friendly Code Review server
commit 89e9d61385

View file

@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2011-2014, 2017-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#include <linux/init.h>
@ -18,7 +19,8 @@ static int msm_pcm_hostless_prepare(struct snd_pcm_substream *substream)
pr_err("%s: invalid params\n", __func__);
return -EINVAL;
}
pm_qos_remove_request(&substream->latency_pm_qos_req);
if (pm_qos_request_active(&substream->latency_pm_qos_req))
pm_qos_remove_request(&substream->latency_pm_qos_req);
return 0;
}