[PATCH v4] pinctrl: sunxi: request the per-bank supply optionally

Linus Walleij linusw at kernel.org
Sun Nov 29 16:17:17 PST 2026


Hi Yang,

thanks for your patch!

On Wed, Nov 18, 2026 at 12:18 AM Yang Siyuan <hsyysy at 163.com> wrote:

> +       if (!np)
> +               return 0;

This is good.

>         snprintf(supply, sizeof(supply), "vcc-p%c", 'a' + bank);
> -       reg = regulator_get(pctl->dev, supply);
> -       if (IS_ERR(reg))
> +       /*
> +        * Use the OF-only lookup: regulator_get_optional() also falls back to
> +        * a global regulator-name lookup and could bind a same-named
> +        * regulator that is not the supply of this bank.
> +        */

Is that a real problem or a theoretical one?

> +       reg = of_regulator_get_optional(pctl->dev, np, supply);
> +       if (IS_ERR(reg)) {
> +               if (PTR_ERR(reg) == -ENODEV)
> +                       return 0;
> +
>                 return dev_err_probe(pctl->dev, PTR_ERR(reg),
>                                      "Couldn't get bank P%c regulator\n",
>                                      'A' + bank);
> +       }

I think Mark Brown want to look at this.

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list