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 EFF64C43334 for ; Tue, 28 Jun 2022 02:25:33 +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 3A39B1675; Tue, 28 Jun 2022 04:24:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3A39B1675 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1656383132; bh=YSTDIn/5O6g5zdHv0HGS4i2zvubu/9DcS+C044Q9JGI=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=tbvAIn2keRPfILWe5hXoqT8u7FCWQTjzkk2Sl8Wb9NZ4vi+7l1fhycO8hCtxRmD8i FFV+sFVcMjkfIh9/PoGiquljFlS7AE20RE6utx/JNySDkR971hSGy+QWHdGT8cLnKU rSEVoBXc0OFTfhzZ+DZHm1BbfopB0x1mB0FXteDc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 9D38AF80166; Tue, 28 Jun 2022 04:24:35 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 30193F80538; Tue, 28 Jun 2022 04:24:35 +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 D7D66F80107 for ; Tue, 28 Jun 2022 04:24:32 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D7D66F80107 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Buie6uFb" 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 8D21D618F4; Tue, 28 Jun 2022 02:24:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0AEEC385A5; Tue, 28 Jun 2022 02:24:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656383070; bh=YSTDIn/5O6g5zdHv0HGS4i2zvubu/9DcS+C044Q9JGI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Buie6uFb2VplUamp8xnEYGxNpNitiBaLZu7VCPn9w4DsdghrjyjQQlL3o4oSAAd6Z 3rssWq2X1GA3vxNydYGPR+rVR0xhqnnu0cdYhwINVlwiX50Df5v1ucCxvlyPpj6Giq YFs9Je6OxghaxPfrjrZ4DxhrgLgPsEfFL6UbeRTTVQFbzIlKbfxYS9CFcRgTXkOmua I9mszlru5zPQAtWWaolySASyzxPdL/tVhHjEbcdLoLzXrDXmEkOt2Jgqcbwk/N4ut+ 9TZCDHM0ZQrHVRhDQcGilpl3x2YljkcfQHNBLHkKUYszrkKrrlAEYfz4+8+SfcoTBH 5QRL2ayOn4dGg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 5.4 07/27] ALSA: x86: intel_hdmi_audio: use pm_runtime_resume_and_get() Date: Mon, 27 Jun 2022 22:23:53 -0400 Message-Id: <20220628022413.596341-7-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220628022413.596341-1-sashal@kernel.org> References: <20220628022413.596341-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 f16e936559c3..e6f6a1b59047 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; @@ -1568,8 +1570,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