From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 80AE01C29 for ; Wed, 23 Nov 2022 09:29:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CB860C433D6; Wed, 23 Nov 2022 09:29:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1669195783; bh=gsVXRYCR9lVIvBRGS7VnApwkMRqk9CPCHhrgfVyh1XM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v6/IiBirPq1EVA0TscQz0ay7GULkey76r4xSIZqFiFEOGOEqFTkGcoR4RFAInwjoA JEw51bcGetYiegHyLybRxk391hylHRfv9+GZaPXltGYL3YBepu/njCWVdEvPB073jc xNyeRmHioxouSGYGrwoB4VgMUIkf/ygtmMDFrDA0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Zhang Qilong , AngeloGioacchino Del Regno , Mark Brown , Sasha Levin Subject: [PATCH 5.15 007/181] ASoC: mt6660: Keep the pm_runtime enables before component stuff in mt6660_i2c_probe Date: Wed, 23 Nov 2022 09:49:30 +0100 Message-Id: <20221123084602.958123457@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221123084602.707860461@linuxfoundation.org> References: <20221123084602.707860461@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Zhang Qilong [ Upstream commit c4ab29b0f3a6f1e167c5a627f7cd036c1d2b7d65 ] It would be better to keep the pm_runtime enables before the IRQ and component stuff. Both of those could start triggering PM runtime events. Signed-off-by: Zhang Qilong Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20221008140522.134912-1-zhangqilong3@huawei.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/mt6660.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/codecs/mt6660.c b/sound/soc/codecs/mt6660.c index a0a3fd60e93a..7d7f97b8c7c4 100644 --- a/sound/soc/codecs/mt6660.c +++ b/sound/soc/codecs/mt6660.c @@ -504,14 +504,14 @@ static int mt6660_i2c_probe(struct i2c_client *client, dev_err(chip->dev, "read chip revision fail\n"); goto probe_fail; } + pm_runtime_set_active(chip->dev); + pm_runtime_enable(chip->dev); ret = devm_snd_soc_register_component(chip->dev, &mt6660_component_driver, &mt6660_codec_dai, 1); - if (!ret) { - pm_runtime_set_active(chip->dev); - pm_runtime_enable(chip->dev); - } + if (ret) + pm_runtime_disable(chip->dev); return ret; -- 2.35.1