Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 89e9d613 authored by Soumya Managoli's avatar Soumya Managoli Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: Add check for pm_qos_req before removal



Check if pm_qos_req is active before removal.

Change-Id: I0076a73ffa6310dbb4cb207ca7a651aa1d3fdf04
Signed-off-by: default avatarSoumya Managoli <quic_c_smanag@quicinc.com>
parent 7d196f83
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
// 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,6 +19,7 @@ static int msm_pcm_hostless_prepare(struct snd_pcm_substream *substream)
		pr_err("%s: invalid params\n", __func__);
		return -EINVAL;
	}
	if (pm_qos_request_active(&substream->latency_pm_qos_req))
		pm_qos_remove_request(&substream->latency_pm_qos_req);
	return 0;
}