The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] pinctrl: cs42l43: fail probe if runtime PM setup fails
@ 2026-11-29 13:44 Jiawen Liu
  2026-11-30  9:57 ` Charles Keepax
  0 siblings, 1 reply; 2+ messages in thread
From: Jiawen Liu @ 2026-11-29 13:44 UTC (permalink / raw)
  To: David Rhodes, Richard Fitzgerald, Charles Keepax, Linus Walleij
  Cc: linux-sound, patches, linux-gpio, linux-kernel

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");
 	pm_runtime_idle(priv->dev);
 
 	pctldev = devm_pinctrl_register(priv->dev, &cs42l43_pin_desc, priv);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] pinctrl: cs42l43: fail probe if runtime PM setup fails
  2026-11-29 13:44 [PATCH] pinctrl: cs42l43: fail probe if runtime PM setup fails Jiawen Liu
@ 2026-11-30  9:57 ` Charles Keepax
  0 siblings, 0 replies; 2+ messages in thread
From: Charles Keepax @ 2026-11-30  9:57 UTC (permalink / raw)
  To: Jiawen Liu
  Cc: David Rhodes, Richard Fitzgerald, Linus Walleij, linux-sound,
	patches, linux-gpio, linux-kernel

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
> 
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-30 10:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox