From patchwork Fri Oct 28 17:34:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maarten Zanders X-Patchwork-Id: 13025440 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 4DC16FA3740 for ; Mon, 31 Oct 2022 06:49:01 +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 506B01658; Mon, 31 Oct 2022 07:48:09 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 506B01658 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1667198939; bh=g/ixEMSnORQnWkGRAB1uubyQ1s+GPqojKJiBg1X1pPw=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=OQ4o9+rz6AiFIbVmbuFp+ltA+/HyqN2WJHosEmZy/fWoWF7OVOP0m6nvfJhzIDQoP l+5Fj0wNgrga1r/uOeWK6q7OnQ0CTqIy4bO91vqZ2SietwA8Ycnjo329ABfK6nMedW +RIw9rod+/hEC6SL+z2NrM7QVamW5fmxMYS9OOtU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id ED685F80588; Mon, 31 Oct 2022 07:45:41 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E566BF8025A; Fri, 28 Oct 2022 19:34:28 +0200 (CEST) Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 99076F80095 for ; Fri, 28 Oct 2022 19:34:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 99076F80095 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=mind.be header.i=@mind.be header.b="Scyhmj02" Received: by mail-ej1-x62a.google.com with SMTP id t25so14589035ejb.8 for ; Fri, 28 Oct 2022 10:34:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mind.be; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HXgFQ2AiirDn7ylvDdK02G7QYybBypCEVhzqiAXGlxg=; b=Scyhmj02CKM5yxBdbaYtrAYm1fwrxtc4tLIwSA/sRtHag12CtQy2AjaU2237oxsWZZ lop/DZe74+wPugi3WBwjHcSgWRIREq0aoa4BTgpCdh3eHEuFzCY4/zGdiV6W8Z5AbIRM QEAqkNt2Xj5VweRGQyCNodWQ2cr69+tVh7giqmXV+LKeahpntt6CD8KkTPWShlb1sbP3 XpDdj7ZUkpc8KQggPzg9gv0H8NBq3KnP6z6toMt5HXEPZNtVK1fw1qTPWBE2X5srE+Bs vmJMbhn5+FgUDKrMLXZASwoAkXQGud+D3HMBxb0SUqHgIPpo2kG8HOUSGpdrOzXVjxxK h0cQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HXgFQ2AiirDn7ylvDdK02G7QYybBypCEVhzqiAXGlxg=; b=W1nlxFVOamKVTUrzBfCldB8nu6fi6vmcfLIdHOhvFumkOAMTxg+RzU6pAnlVWwvrhN d7i0lzLjuUR7iIwLtO4B751CnmcJwHJvzKj67lpNgZmVr2x4r5KaURftjoezH36GV7Hj B4hUq1FqzUWiexrJXzSLifEB+bCMM0V2b/GDFhVpQOHGefjnvaaPWFw4VoU0BkRon9vS 36lnx6TVxxfwotCuLyiwsw3NwFf+EWC8L8REpFPPmEuEiYwOveuKzAXkCx/kZVqCzBP2 QZiNy1f1FFk7Qt9PXQRDPZTulKqm3u1s12prAVX8Nz4vXpMNwwEfaP5xntDJHSUg37s4 vhkA== X-Gm-Message-State: ACrzQf1mGF5WFU/BhyxyUWkHUOwtbd6/6ukT7U4MLnVXERwHzj4VRgtS KvJJ2Lj0A8PvablV2rdkCunPlQ== X-Google-Smtp-Source: AMsMyM43tumq4AVpXyo00mGeFeYdaSFpUgltayHAirnrZ1oFPURcmdLfFC4Anm4hdUD30bsqCUmHfQ== X-Received: by 2002:a17:907:3da2:b0:78d:3b45:11d9 with SMTP id he34-20020a1709073da200b0078d3b4511d9mr407191ejc.87.1666978460491; Fri, 28 Oct 2022 10:34:20 -0700 (PDT) Received: from dtpc.zanders.be (78-22-137-109.access.telenet.be. [78.22.137.109]) by smtp.gmail.com with ESMTPSA id v8-20020a170906b00800b0078dce9984afsm2388868ejy.220.2022.10.28.10.34.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 10:34:20 -0700 (PDT) From: Maarten Zanders To: Shengjiu Wang , Xiubo Li , Fabio Estevam , Nicolin Chen , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Subject: [PATCH v3] ASoC: fsl_asrc fsl_esai fsl_sai: allow CONFIG_PM=N Date: Fri, 28 Oct 2022 19:34:04 +0200 Message-Id: <20221028173405.155264-1-maarten.zanders@mind.be> X-Mailer: git-send-email 2.37.3 In-Reply-To: References: MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 31 Oct 2022 07:45:34 +0100 Cc: linuxppc-dev@lists.ozlabs.org, alsa-devel@alsa-project.org, Maarten Zanders , Daniel Baluta , linux-kernel@vger.kernel.org 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" When CONFIG_PM=N, pm_runtime_put_sync() returns -ENOSYS which breaks the probe function of these drivers. Other users of pm_runtime_put_sync() typically don't check the return value. In order to keep the program flow as intended, check for -ENOSYS. This commit is similar to commit 0434d3f4525a ("mailbox/omap: Handle if CONFIG_PM is disabled") This commit fixes commit cab04ab5900f ("ASoC: fsl_asrc: Don't use devm_regmap_init_mmio_clk") commit 203773e39347 ("ASoC: fsl_esai: Don't use devm_regmap_init_mmio_clk") commit 2277e7e36b4b ("ASoC: fsl_sai: Don't use devm_regmap_init_mmio_clk") Signed-off-by: Maarten Zanders Reviewed-by: Daniel Baluta --- sound/soc/fsl/fsl_asrc.c | 2 +- sound/soc/fsl/fsl_esai.c | 2 +- sound/soc/fsl/fsl_sai.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c index 936aef5d2767..e16e7b3fa96c 100644 --- a/sound/soc/fsl/fsl_asrc.c +++ b/sound/soc/fsl/fsl_asrc.c @@ -1232,7 +1232,7 @@ static int fsl_asrc_probe(struct platform_device *pdev) } ret = pm_runtime_put_sync(&pdev->dev); - if (ret < 0) + if (ret < 0 && ret != -ENOSYS) goto err_pm_get_sync; ret = devm_snd_soc_register_component(&pdev->dev, &fsl_asrc_component, diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c index 5c21fc490fce..17fefd27ec90 100644 --- a/sound/soc/fsl/fsl_esai.c +++ b/sound/soc/fsl/fsl_esai.c @@ -1069,7 +1069,7 @@ static int fsl_esai_probe(struct platform_device *pdev) regmap_write(esai_priv->regmap, REG_ESAI_RSMB, 0); ret = pm_runtime_put_sync(&pdev->dev); - if (ret < 0) + if (ret < 0 && ret != -ENOSYS) goto err_pm_get_sync; /* diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index 81f89f6767a2..e60c7b344562 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c @@ -1446,7 +1446,7 @@ static int fsl_sai_probe(struct platform_device *pdev) } ret = pm_runtime_put_sync(dev); - if (ret < 0) + if (ret < 0 && ret != -ENOSYS) goto err_pm_get_sync; /*