Re: [PATCH] pinctrl: cs42l43: fail probe if runtime PM setup fails
From: Charles Keepax
Date: Mon Nov 30 2026 - 05:01:10 EST
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@xxxxxx>
> ---
> 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
>
>