From patchwork Fri Oct 28 15:45:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maarten Zanders X-Patchwork-Id: 12406 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp907475wru; Fri, 28 Oct 2022 08:55:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6Eqls5MU0gGsH/HghlojiM45f04FxWsf/QgKvhtGBw/JkpkswWcQg8B76V+7AlthRsWIJq X-Received: by 2002:a17:907:7e95:b0:78d:e9cf:82c7 with SMTP id qb21-20020a1709077e9500b0078de9cf82c7mr7283ejc.724.1666972509595; Fri, 28 Oct 2022 08:55:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666972509; cv=none; d=google.com; s=arc-20160816; b=cS+GQt9+qKYuHbV7RkrjPDURqJ/dnsRcTDEd+TX8UsaZNvhHlGibkACm9PrTmqcpb5 /FMJa34180IuAK61PmYVrtET/bRejGaSq1+02LHGuKVFYBEmDrjhJok3g+h58w+LsdCy 3rRxt7KIAaOVkhMVnh5bbfunNNfqOIFdmiNGKDTswVx5n1Cye0tkQdQES97MSo0TnKcD Q1c/Kd6z4idWO3llW2DGY1uQ+OGgMnYW5GhqBqC5InYHg9doPG3i7HAbemkQJnabgfLw dC2dQKf1ZaFRgOwzSMtPpvOZOx5Z5xF40ft/u/cKokY5CnscOAgwwJiuKvVLwkUt8ZCL 3BiA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=K9dtDrkTtJDWiY55QD7A/AEXd7H01h6LFKl1oWBL6fQ=; b=WSnSGuY8jdLPCt8HNDRoLobQlS2GPE4heHOMRc7rNoZCBOuze5rXrcMryKWCqw/VwL yE/4IzImPpXpM8LYYpzcE1uxXRYpVSpfySwNVTY/luDFvCrvJ+CrFAgD7Rmb1cagWpX1 G9ESQo/CzHrlKZPsNZKc2iuO4LeHfXaQZJlGizT7ENPYP0NJzyqA1jgLKi36plvsMaZI zZ2+SvOPh/O20XYwzp+76XyyfzinAn5lNvWlI0BEdR2N3Z70ex8vATmcacZ+Q/Fyvcy0 gAWOs2mHs/Z4g2OIyz2snIjDWYKw7za8nRKXwdet3HLNAndfx8N4j9308E4ToyVFak1w 0vSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mind.be header.s=google header.b=b7KpZsfq; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g15-20020a1709065d0f00b0078da5f6ed9esi4967226ejt.779.2022.10.28.08.54.44; Fri, 28 Oct 2022 08:55:09 -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; dkim=pass header.i=@mind.be header.s=google header.b=b7KpZsfq; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229868AbiJ1PqL (ORCPT + 99 others); Fri, 28 Oct 2022 11:46:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229743AbiJ1PqJ (ORCPT ); Fri, 28 Oct 2022 11:46:09 -0400 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E33AF1B5764 for ; Fri, 28 Oct 2022 08:46:05 -0700 (PDT) Received: by mail-ed1-x531.google.com with SMTP id x2so8471988edd.2 for ; Fri, 28 Oct 2022 08:46:05 -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=K9dtDrkTtJDWiY55QD7A/AEXd7H01h6LFKl1oWBL6fQ=; b=b7KpZsfqzkutWlZGik4MAB1Tx6dfC3eHgxL5t+NdtcgaRf3bRJlJmpysb/wWaxN3uV O4fiJWluRqxiZGZkVAeZN95K960I3FdolJKeE6hrTrREE/C1FWpCylkLwjAnL5eUy+Rm cu51JQj0wsZSQz5IhNg22FlJln2wsMmaUqJKXyZgyiT7jIAh3EIEaNMUYx/fm5yK+XhH qD/NUodEX9yxxkKKY+s/cVr6feGYrVfzuhvT0g/lDAEJHkiXqqcIgeoa64GshzeL6c+O V4FxWupBqrgnm9yejdqyzW6K9Cv139uVN5D5WJNQUFm+9eWR162wnk8PPJ7a6LMlE8B6 gDkg== 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=K9dtDrkTtJDWiY55QD7A/AEXd7H01h6LFKl1oWBL6fQ=; b=ft5QPiaHF4TFHAxt1FkaxSDeXnh8lDSGNughQwOqEnYnoTW4jY2cZT/rHgyyoCP4c8 SAriy6hZLnaqTFP75sDJA+jdojyg9WBI+NFyoM7pi1kZZ5+cXyH9mMNmZukOqNc1VYSy afwUifor9EijMcu+ksGFgq9/4bGPpmJ+0bcYWImnCYwT6zFVdC59EiLlWBJv7X+CP45U r2TcgJxmQKgbhmFJwxOe1MfeSjhUUTy26iTZxIC9+MBimCbqd9uXKN/AKvsEzNo4v/wV 22ElROX2styQ+4tlMpptOgfSjWa4C3LVbuAK+dhUfMMuq1eH6bL7s5Jt/PcUtAT6ceXk 3Hjg== X-Gm-Message-State: ACrzQf2Oqhi3HActgGDCfqhGLRVyPWh66TOPqrf/m4dRzR9rCI8lp9tu mQORWrIbm1VmOWmRg+3vRh0lGA== X-Received: by 2002:a50:eb05:0:b0:457:c6f5:5f65 with SMTP id y5-20020a50eb05000000b00457c6f55f65mr26705edp.311.1666971964506; Fri, 28 Oct 2022 08:46:04 -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 18-20020a170906309200b007a23fe14442sm2329092ejv.195.2022.10.28.08.46.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 08:46:04 -0700 (PDT) From: Maarten Zanders To: Shengjiu Wang , Xiubo Li , Fabio Estevam , Nicolin Chen , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: Maarten Zanders , alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] ASoC: fsl_asrc fsl_esai fsl_sai: allow CONFIG_PM=N Date: Fri, 28 Oct 2022 17:45:34 +0200 Message-Id: <20221028154534.112175-1-maarten.zanders@mind.be> X-Mailer: git-send-email 2.37.3 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747941620198411381?= X-GMAIL-MSGID: =?utf-8?q?1747947366109270491?= 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 --- 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; /*