Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp4168161rwr; Mon, 8 May 2023 04:07:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4LJEXe/esZiTaGU5uhwmZx5cI2Wh9xABqG93sUXoT9lj2qZskvx/x0GXMALVADhsjZEe4L X-Received: by 2002:a17:90a:1503:b0:24e:14a4:9b92 with SMTP id l3-20020a17090a150300b0024e14a49b92mr11558874pja.5.1683544050769; Mon, 08 May 2023 04:07:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683544050; cv=none; d=google.com; s=arc-20160816; b=Z1Ii/aDKF1ylV2p2pf7pn+M7ohLCegWjXPbhxrfgZk+e5pQF/DsweA4WYXPcuDLt2B CilbHUTkG95k+oPpMEhIoKh/9BjWmQM6p2gDjW+5hCbKnOfO3FZ9n7kF4qKeaS0fbKBo SUKxZEJddGNUwCYjB4kgu7N0kkV2eMpY97oE2i5nQxnqGthWfp9h2cjSxLho8WdFV7+V i9qFdTBQqMe2UtAmCl0jmMNT6AGD1U7/gENpaB1Kk6pD4eE6979u0ZxTgZSF6pivNRyP BjNW3C+hZ6jm+aiwjVyyFUQqoufhXUX48C5N2I3C/QdIST+E0CdZAZufFPtxGmSXfLGR Mqjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:to:from; bh=sR8TuLuiv4vZGOql3zAzPbe4DLsjXL7XKGxx+F/7XUg=; b=vn9toGbYHaw9wK8Coc8mijDTdaE2bFAzKUQSlhO1L+roNeqzFg+URQ+/6UQAGl/+3J TojtuaLDe1pooBWcbW2dqqHhEWHB/mQ71/LCFxIFsbHDC168QNL3+jWOKruRkc133mcH wZPzIChwwvT5qZ+gMNSWimelh5ylwGTAP5G7w/LDBCBwBW8cl0UDXm/VgQni56m0WRrO Q8jmlw772S/hEU31h1JbbQsbvTIlzLP+LS7p2h0X5VFvwidXEt4TfMhLMRw78j4OgiFG nFpkZMAaEq9QzOaUa2OSqYQNFLGQjDvnolFuKJrXt4MfMwbXTEnTXpD9qJaMXnuGT0aS h9GQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kk6-20020a17090b4a0600b002478bba4da2si1794874pjb.127.2023.05.08.04.07.16; Mon, 08 May 2023 04:07:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235178AbjEHKrb (ORCPT + 99 others); Mon, 8 May 2023 06:47:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235094AbjEHKqw (ORCPT ); Mon, 8 May 2023 06:46:52 -0400 Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 889112A9EE for ; Mon, 8 May 2023 03:46:43 -0700 (PDT) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id E7886200C78; Mon, 8 May 2023 12:46:41 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id AF78520096F; Mon, 8 May 2023 12:46:41 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 2789518002DC; Mon, 8 May 2023 18:46:40 +0800 (+08) From: Shengjiu Wang To: shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, nicoleotsuka@gmail.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH] ASoC: fsl_micfil: Fix error handler with pm_runtime_enable Date: Mon, 8 May 2023 18:16:36 +0800 Message-Id: <1683540996-6136-1-git-send-email-shengjiu.wang@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is error message when defer probe happens: fsl-micfil-dai 30ca0000.micfil: Unbalanced pm_runtime_enable! Fix the error handler with pm_runtime_enable and add fsl_micfil_remove() for pm_runtime_disable. Fixes: 47a70e6fc9a8 ("ASoC: Add MICFIL SoC Digital Audio Interface driver.") Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_micfil.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/sound/soc/fsl/fsl_micfil.c b/sound/soc/fsl/fsl_micfil.c index 94341e4352b3..3f08082a55be 100644 --- a/sound/soc/fsl/fsl_micfil.c +++ b/sound/soc/fsl/fsl_micfil.c @@ -1159,7 +1159,7 @@ static int fsl_micfil_probe(struct platform_device *pdev) ret = devm_snd_dmaengine_pcm_register(&pdev->dev, NULL, 0); if (ret) { dev_err(&pdev->dev, "failed to pcm register\n"); - return ret; + goto err_pm_disable; } fsl_micfil_dai.capture.formats = micfil->soc->formats; @@ -1169,9 +1169,20 @@ static int fsl_micfil_probe(struct platform_device *pdev) if (ret) { dev_err(&pdev->dev, "failed to register component %s\n", fsl_micfil_component.name); + goto err_pm_disable; } return ret; + +err_pm_disable: + pm_runtime_disable(&pdev->dev); + + return ret; +} + +static void fsl_micfil_remove(struct platform_device *pdev) +{ + pm_runtime_disable(&pdev->dev); } static int __maybe_unused fsl_micfil_runtime_suspend(struct device *dev) @@ -1232,6 +1243,7 @@ static const struct dev_pm_ops fsl_micfil_pm_ops = { static struct platform_driver fsl_micfil_driver = { .probe = fsl_micfil_probe, + .remove_new = fsl_micfil_remove, .driver = { .name = "fsl-micfil-dai", .pm = &fsl_micfil_pm_ops, -- 2.34.1