From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3D55CC43334 for ; Tue, 28 Jun 2022 02:24:20 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 720171672; Tue, 28 Jun 2022 04:23:28 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 720171672 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1656383058; bh=tWZ9EunSuGCCxl4UhxUmXpJelRVkeuq3GF+P6mU2hRM=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=aN1cQVthz5meXBZ37MKRHqEYuU9O93f5STDeNetUgzdWlcLM14Qc6Lbpdc/0QJctP iHUxiR5k43e2Y/zVYNRUWKionYLGQ58j7cs6Pn0L0zVT4qDYK3oEvXEVqvZYkXLi5a L2/3vLojfhh6A0vBVFEuhDosaQBhdf3DHjQ13EQE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E0A4BF80539; Tue, 28 Jun 2022 04:23:27 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6F9ACF8049E; Tue, 28 Jun 2022 04:23:24 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 82A47F8028B for ; Tue, 28 Jun 2022 04:23:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 82A47F8028B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="grVnVqMT" Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4717C61861; Tue, 28 Jun 2022 02:23:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 121C2C34115; Tue, 28 Jun 2022 02:23:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656382996; bh=tWZ9EunSuGCCxl4UhxUmXpJelRVkeuq3GF+P6mU2hRM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=grVnVqMTu6z/6XrdVupCZSpULLlqbIwEgpQnblRPa7KkecN7g/PEjsy82j+ot5a70 5aKUTG90bTZzVq6F96S56Vrekx1yZWZGPZvFWeBUJWmwbRIsmQPVuCh+rP0QaoUDjM hVYjh5HkbJzfKFBYEZmQde7aEr2CRDXr3UvOEMnuLujk8fPFYsUn/dJpQh/DNFZULk /qmEmxq+yxpapFV4KvCiZUheKdiFZLWDrITqqlHtna00q7GgGUelrzHbDAYNEX0zYE WWjSzzRb0LHSdcpnNsutdwlEuJfOd8W3LuYhxLJHbwFV3cfUjPFdk7MfkS824Q6VHZ UX4DKw4W7r+0w== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 5.10 12/34] ALSA: x86: intel_hdmi_audio: use pm_runtime_resume_and_get() Date: Mon, 27 Jun 2022 22:22:19 -0400 Message-Id: <20220628022241.595835-12-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220628022241.595835-1-sashal@kernel.org> References: <20220628022241.595835-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Cc: Sasha Levin , alsa-devel@alsa-project.org, jiasheng@iscas.ac.cn, Kai Vehmanen , Takashi Iwai , tiwai@suse.com, Pierre-Louis Bossart , Ranjani Sridharan , nizhen@uniontech.com, Bard Liao , gushengxian@yulong.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Pierre-Louis Bossart [ Upstream commit bb30b453fedac277d66220431fd7063d9ddc10d8 ] The current code does not check for errors and does not release the reference on errors. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220616222910.136854-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/x86/intel_hdmi_audio.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c index 2c150bce30bb..bb0a03e14fed 100644 --- a/sound/x86/intel_hdmi_audio.c +++ b/sound/x86/intel_hdmi_audio.c @@ -1067,7 +1067,9 @@ static int had_pcm_open(struct snd_pcm_substream *substream) intelhaddata = snd_pcm_substream_chip(substream); runtime = substream->runtime; - pm_runtime_get_sync(intelhaddata->dev); + retval = pm_runtime_resume_and_get(intelhaddata->dev); + if (retval < 0) + return retval; /* set the runtime hw parameter with local snd_pcm_hardware struct */ runtime->hw = had_pcm_hardware; @@ -1564,8 +1566,12 @@ static void had_audio_wq(struct work_struct *work) container_of(work, struct snd_intelhad, hdmi_audio_wq); struct intel_hdmi_lpe_audio_pdata *pdata = ctx->dev->platform_data; struct intel_hdmi_lpe_audio_port_pdata *ppdata = &pdata->port[ctx->port]; + int ret; + + ret = pm_runtime_resume_and_get(ctx->dev); + if (ret < 0) + return; - pm_runtime_get_sync(ctx->dev); mutex_lock(&ctx->mutex); if (ppdata->pipe < 0) { dev_dbg(ctx->dev, "%s: Event: HAD_NOTIFY_HOT_UNPLUG : port = %d\n", -- 2.35.1