Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9076449pxu; Mon, 28 Dec 2020 06:05:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJzizq8yvgGIomhI69ObfxWu+8Oa67WzPEYqcXZB/imO5Phs8ZWjlODh1uIlmxEJ40H1X4tK X-Received: by 2002:a17:907:60a:: with SMTP id wp10mr42383803ejb.205.1609164350920; Mon, 28 Dec 2020 06:05:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609164350; cv=none; d=google.com; s=arc-20160816; b=yJn0Nh/bVMAy9Dou0SS0EN3WbKqaaQPHUMRjGu0h/WRVhZUxbevqNJBpmwJQIjN7uz p4avIr0eI2IxAknxIDUYLlDnZfXVNiydm4Y+d/XFCmrXCkJFyCfdbf+MYI1asltPn+Cr Z+tu5/ev1p00QQsRrv2wmXwrlE45WxcAXLZ32km8CIQ/56yKN7PYOR0wJ/xAhd9YA72P kAh9E1luYECK9aEhq/xOee0uEQ94USZs4YXGbGXMBoIlz2BC05s5sV8lymk5X5SXqDlT /cve7hirMZdWKK3VnYPy1ZPQWCJQelzfpgKm1rppR7BpSHWFkWTuQ9VXGibOnjef0ZtY sMyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6MPPlxM6tW7K6vz2Hb0xTMw00xTApI2fxWMMVhK2bF8=; b=n7yRR5PnsLWvCOU+dCaTyiUabI3AjgDHfYi81Odsilmc11fguhtyQjzs9gW1IJCl94 9vUYUalDkcesdkF+rpGj9uOegFqAMmYAtbHNCxuxdiB8eTKknfHtmBMxLFBXd+nCjbZX Hdr/t3s0mn3bsnJLeMzSyyIfywCPOZnkdq5/ZsigKk7ORGWspInYl2ufGiHaxViACelb +czKaPiEP+KKGnXsJ9xVm6HLzlRyNNybD4jRD6o4BkizscKUKz5APmoh5ogIq6DnYZHS H+4KVvWrlZtxV27hDc0TpKQp04Ywbz5BsvQvBUAgg00D6hF979NNYKGBele7hB5whJ6x L1Qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nshB7PMX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s20si12223334eji.387.2020.12.28.06.05.28; Mon, 28 Dec 2020 06:05:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nshB7PMX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437174AbgL1ODd (ORCPT + 99 others); Mon, 28 Dec 2020 09:03:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:36052 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437147AbgL1OD1 (ORCPT ); Mon, 28 Dec 2020 09:03:27 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 241042063A; Mon, 28 Dec 2020 14:03:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164191; bh=IenCtjW8f0OaR6AvdVX/H0MYaKeqgP2awSBAtDkT5bg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nshB7PMXapCTKCn9A+18VSXUyfJPnyatKpnGSC+nbk+EYbxbQou6zpLS/OUShbG/S SwPcS842xeWWIhW0S6/nPclWnE7cCkAZl1X5AzWuLiwzmfk0GKHw8Xs0OjhwxqBxFn hSOLtA1DshMyU3NiT20hzIHzGHTo8w/HIN/WsJ48= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhang Qilong , Richard Fitzgerald , Mark Brown , Sasha Levin Subject: [PATCH 5.10 094/717] ASoC: wm8994: Fix PM disable depth imbalance on error Date: Mon, 28 Dec 2020 13:41:32 +0100 Message-Id: <20201228125025.480001876@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zhang Qilong [ Upstream commit b8161cbe55a1892a19a318eaebbda92438fa708c ] The pm_runtime_enable will increase power disable depth. Thus a pairing decrement is needed on the error handling path to keep it balanced according to context. Fixes: 57e265c8d71fb ("ASoC: wm8994: Move runtime PM init to platform device init") Signed-off-by: Zhang Qilong Reviewed-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20201111041326.1257558-2-zhangqilong3@huawei.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/wm8994.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index fc9ea198ac799..f57884113406b 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c @@ -4645,8 +4645,12 @@ static int wm8994_probe(struct platform_device *pdev) pm_runtime_enable(&pdev->dev); pm_runtime_idle(&pdev->dev); - return devm_snd_soc_register_component(&pdev->dev, &soc_component_dev_wm8994, + ret = devm_snd_soc_register_component(&pdev->dev, &soc_component_dev_wm8994, wm8994_dai, ARRAY_SIZE(wm8994_dai)); + if (ret < 0) + pm_runtime_disable(&pdev->dev); + + return ret; } static int wm8994_remove(struct platform_device *pdev) -- 2.27.0