Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Jiawen Liu <1298662399@qq.com>
Cc: David Rhodes <david.rhodes@cirrus.com>,
	Richard Fitzgerald <rf@opensource.cirrus.com>,
	Linus Walleij <linusw@kernel.org>,
	linux-sound@vger.kernel.org, patches@opensource.cirrus.com,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] pinctrl: cs42l43: fail probe if runtime PM setup fails
Date: Mon, 30 Nov 2026 09:57:09 +0000	[thread overview]
Message-ID: <aw1Idd60QCfYvd4M@opensource.cirrus.com> (raw)
In-Reply-To: <tencent_99826EAE931660C42F52657EFD51112EA406@qq.com>

On Sun, Nov 29, 2026 at 05:44:22PM +0400, Jiawen Liu wrote:
> cs42l43_pin_probe() ignored a failure from devm_pm_runtime_enable(). The
> helper rolls runtime PM back when action registration fails, but the
> probe could still register pinctrl and GPIO providers that require
> runtime resume for hardware access.
> 
> Propagate the setup error before requesting runtime idle and registering
> either provider.
> 
> Fixes: d5282a539297 ("pinctrl: cs42l43: Add support for the cs42l43")
> Signed-off-by: Jiawen Liu <1298662399@qq.com>
> ---
>  drivers/pinctrl/cirrus/pinctrl-cs42l43.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/pinctrl/cirrus/pinctrl-cs42l43.c b/drivers/pinctrl/cirrus/pinctrl-cs42l43.c
> index a1c839b355578..71fc493de83e2 100644
> --- a/drivers/pinctrl/cirrus/pinctrl-cs42l43.c
> +++ b/drivers/pinctrl/cirrus/pinctrl-cs42l43.c
> @@ -585,7 +585,10 @@ static int cs42l43_pin_probe(struct platform_device *pdev)
>  
>  	device_set_node(priv->dev, fwnode);
>  
> -	devm_pm_runtime_enable(priv->dev);
> +	ret = devm_pm_runtime_enable(priv->dev);
> +	if (ret)
> +		return dev_err_probe(priv->dev, ret,
> +				     "Failed to enable runtime PM\n");

devm_pm_runtime_enable can only fail with -ENOMEM so we should
probably drop the error message and just return the error.

Otherwise, looks good.

Thanks,
Charles

>  	pm_runtime_idle(priv->dev);
>  
>  	pctldev = devm_pinctrl_register(priv->dev, &cs42l43_pin_desc, priv);
> -- 
> 2.34.1
> 
> 

      reply	other threads:[~2026-11-30 10:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-29 13:44 [PATCH] pinctrl: cs42l43: fail probe if runtime PM setup fails Jiawen Liu
2026-11-30  9:57 ` Charles Keepax [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aw1Idd60QCfYvd4M@opensource.cirrus.com \
    --to=ckeepax@opensource.cirrus.com \
    --cc=1298662399@qq.com \
    --cc=david.rhodes@cirrus.com \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=rf@opensource.cirrus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox