From patchwork Mon Jul 12 06:11:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 472980 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2683838jao; Mon, 12 Jul 2021 00:24:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOmkiTWHtzyMC1CZZL4ysN9d9HLC/DJHEQyG7TeNYZFhenk0syVW11zsXFOjIChaEVFN0s X-Received: by 2002:a17:906:e10b:: with SMTP id gj11mr32704166ejb.402.1626074681784; Mon, 12 Jul 2021 00:24:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626074681; cv=none; d=google.com; s=arc-20160816; b=WpX3jjDs3PC8hUGFncfBj4oFQBWmJv9FkIw57wmtS9ZaEqE5n8XuBhGaNI4GD5+8fX zaX+B2kkP4nvYtMXbwFYbbtUHMRnSMa2nUYf8SkXSHdxslROX20NQCvrNXNwdEmkOKOk v0jzxyThWtAI+4v1FKsKiBGaLgv2Zp8/WjWnscajgpJd7s+4T2YB4LNZYBWWsZr/+r5B kV+YIEpEuBkASuFKt4Z+1YC2DalmjM/RkQ4PpZVL/t9iQKJiCqjJW6e92U+a03JXsp1i X4y91uuXJcyt5kPmMBmJ3laanOyKnlEOGxQeVGzo3dg/bYg7B7YXq1qPSYB/sFE0SyAk o3bQ== 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=Ig9fX00Vbm2k3WJdSD452aZxxISxzFyp7vHBTAxrTb8=; b=TsqbNI4hW/m7LCnf8BPrjCZrP/eDLpW+pSeU2B/NNy3iCpCRE2yFUawiMIzKrfEsUY F2FbxjLPWAgG7+zZY6Af0wByVC1Lh+OyvYxBCO/d1FPKqVtdd/SSZUOlEQO0/un65iF+ lgZFUhCtEqv341qvfC8z156xlBmcbrnnmoLPUWoUQGSPn3aYDl9EG8130iKatggt420s dCRNumCIcFt1ax5WMggASwwJnOO1JxF+6ZlhN55VGkvrEqJrg1mDgdGqJleFcBAey+WD rgXRsTL1J2549BdKcf7kCH8xzasERD5OgGQVuZKj7R+w99sot8Ao5WO71Zgwjb4wffdh G6+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="18nw/0d6"; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 d9si16909677edq.169.2021.07.12.00.24.41; Mon, 12 Jul 2021 00:24:41 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-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="18nw/0d6"; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S245633AbhGLH1S (ORCPT + 12 others); Mon, 12 Jul 2021 03:27:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:35096 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345404AbhGLHZa (ORCPT ); Mon, 12 Jul 2021 03:25:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6F64D613D8; Mon, 12 Jul 2021 07:22:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626074562; bh=WQfvbECbqx2bn09rVMqIHrBWpHPocQUzygFRbshRf/U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=18nw/0d6hizjrPNeNkA6zAwM6odmKEf1fYSSIZxC0FWUs1f7Y8AJvxlJm0VIbaVUE +96uv/Ba3VhJMs4+k1AuEhE7vLoeikprlx15kuYOaLhQOSSWxmrnU3XCIwxeJ4a5Xu fngkQEABMUElAto+yQvEeTEaRhu7j82IIVJAjm74= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shengjiu Wang , Mark Brown , Sasha Levin Subject: [PATCH 5.12 619/700] ASoC: fsl_spdif: Fix error handler with pm_runtime_enable Date: Mon, 12 Jul 2021 08:11:42 +0200 Message-Id: <20210712061041.701885748@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060924.797321836@linuxfoundation.org> References: <20210712060924.797321836@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Shengjiu Wang [ Upstream commit 28108d71ee11a7232e1102effab3361049dcd3b8 ] There is error message when defer probe happens: fsl-spdif-dai 2dab0000.spdif: Unbalanced pm_runtime_enable! Fix the error handler with pm_runtime_enable and add fsl_spdif_remove() for pm_runtime_disable. Fixes: 9cb2b3796e08 ("ASoC: fsl_spdif: Add pm runtime function") Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1623392318-26304-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/fsl/fsl_spdif.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) -- 2.30.2 diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c index 174e558224d8..e5d366b2a6a4 100644 --- a/sound/soc/fsl/fsl_spdif.c +++ b/sound/soc/fsl/fsl_spdif.c @@ -1400,16 +1400,29 @@ static int fsl_spdif_probe(struct platform_device *pdev) &spdif_priv->cpu_dai_drv, 1); if (ret) { dev_err(&pdev->dev, "failed to register DAI: %d\n", ret); - return ret; + goto err_pm_disable; } ret = imx_pcm_dma_init(pdev, IMX_SPDIF_DMABUF_SIZE); - if (ret && ret != -EPROBE_DEFER) - dev_err(&pdev->dev, "imx_pcm_dma_init failed: %d\n", ret); + if (ret) { + dev_err_probe(&pdev->dev, ret, "imx_pcm_dma_init failed\n"); + goto err_pm_disable; + } + + return ret; +err_pm_disable: + pm_runtime_disable(&pdev->dev); return ret; } +static int fsl_spdif_remove(struct platform_device *pdev) +{ + pm_runtime_disable(&pdev->dev); + + return 0; +} + #ifdef CONFIG_PM static int fsl_spdif_runtime_suspend(struct device *dev) { @@ -1512,6 +1525,7 @@ static struct platform_driver fsl_spdif_driver = { .pm = &fsl_spdif_pm, }, .probe = fsl_spdif_probe, + .remove = fsl_spdif_remove, }; module_platform_driver(fsl_spdif_driver);