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

From: Linus Walleij

Date: Sun Nov 29 2026 - 19:17:37 EST


Hi Yang,

thanks for your patch!

On Wed, Nov 18, 2026 at 12:18 AM Yang Siyuan <hsyysy@xxxxxxx> 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