Re: [PATCH 3/8] pinctrl: qcom: Register functions before enabling pinctrl
From: Dmitry Baryshkov
Date: Tue Apr 21 2026 - 21:46:25 EST
On Tue, Apr 21, 2026 at 11:45:09AM +0200, Alexandre MINETTE via B4 Relay wrote:
> From: Alexandre MINETTE <contact@xxxxxxxxxxx>
>
> Register Qualcomm pinctrl with devm_pinctrl_register_and_init() so pin
> functions can be added before the pinctrl device is enabled.
>
> This lets pinmux_generic_add_pinfunction() populate the function list
> before consumers request states during pinctrl_enable().
Why is this required? Could you please extend the commit message?
>
> Signed-off-by: Alexandre MINETTE <contact@xxxxxxxxxxx>
> ---
> drivers/pinctrl/qcom/pinctrl-msm.c | 15 ++++++++++-----
> 1 file changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
> index 45b3a2763eb8..a2a1e0835735 100644
> --- a/drivers/pinctrl/qcom/pinctrl-msm.c
> +++ b/drivers/pinctrl/qcom/pinctrl-msm.c
> @@ -1593,11 +1593,11 @@ int msm_pinctrl_probe(struct platform_device *pdev,
> pctrl->desc.pins = pctrl->soc->pins;
> pctrl->desc.npins = pctrl->soc->npins;
>
> - pctrl->pctrl = devm_pinctrl_register(&pdev->dev, &pctrl->desc, pctrl);
> - if (IS_ERR(pctrl->pctrl)) {
> - dev_err(&pdev->dev, "Couldn't register pinctrl driver\n");
> - return PTR_ERR(pctrl->pctrl);
> - }
> + ret = devm_pinctrl_register_and_init(&pdev->dev, &pctrl->desc,
> + pctrl, &pctrl->pctrl);
> + if (ret)
> + return dev_err_probe(&pdev->dev, ret,
> + "Couldn't register pinctrl driver\n");
>
> for (i = 0; i < soc_data->nfunctions; i++) {
> func = &soc_data->functions[i];
> @@ -1607,6 +1607,11 @@ int msm_pinctrl_probe(struct platform_device *pdev,
> return ret;
> }
>
> + ret = pinctrl_enable(pctrl->pctrl);
> + if (ret)
> + return dev_err_probe(&pdev->dev, ret,
> + "Couldn't enable pinctrl driver\n");
> +
> ret = msm_gpio_init(pctrl);
> if (ret)
> return ret;
>
> --
> 2.43.0
>
>
--
With best wishes
Dmitry