mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@arm.com>
To: Pablo Mazzini <pmazzini@gmail.com>, Linus Walleij <linusw@kernel.org>
Cc: Chen-Yu Tsai <wens@kernel.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] pinctrl: sunxi: dt: do not accumulate npins across probe attempts
Date: Mon, 12 Oct 2026 10:40:26 +0200	[thread overview]
Message-ID: <803c1787-999e-4239-bccd-b89e7a066961@arm.com> (raw)
In-Reply-To: <20261007060107.62221-1-pmazzini@gmail.com>

Hi,

On 10/7/26 08:01, Pablo Mazzini wrote:
> init_pins_table() adds to npins in the driver's static descriptor, so
> after a probe deferral the count doubles and the next probe fails with
> "pin 0 already registered". Reset it first.

Yes, thanks, this is what I had in mind. And I think it deserves some 
backports:

> Signed-off-by: Pablo Mazzini <pmazzini@gmail.com>

Fixes: f5e2cd34b12f ("pinctrl: sunxi: allow reading mux values from DT")
Reviewed-by: Andre Przywara <andre.przywara@arm.com>

Cheers,
Andre

> ---
> v2: reset npins instead of counting into a local (Andre)
> 
>   drivers/pinctrl/sunxi/pinctrl-sunxi-dt.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi-dt.c b/drivers/pinctrl/sunxi/pinctrl-sunxi-dt.c
> index 50a16f3bd131..8bcd566593ae 100644
> --- a/drivers/pinctrl/sunxi/pinctrl-sunxi-dt.c
> +++ b/drivers/pinctrl/sunxi/pinctrl-sunxi-dt.c
> @@ -84,6 +84,7 @@ static struct sunxi_desc_pin *init_pins_table(struct device *dev,
>   	 * Find the total number of pins.
>   	 * Also work out how much memory we need to store all the pin names.
>   	 */
> +	desc->npins = 0;
>   	for (i = 0; i < SUNXI_PINCTRL_MAX_BANKS; i++) {
>   		desc->npins += pins_per_bank[i];
>   		if (pins_per_bank[i] < 10) {


  reply	other threads:[~2026-10-12  8:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-07  6:01 Pablo Mazzini
2026-10-12  8:40 ` Andre Przywara [this message]
2026-10-12  9:30 ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=803c1787-999e-4239-bccd-b89e7a066961@arm.com \
    --to=andre.przywara@arm.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=linusw@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=pmazzini@gmail.com \
    --cc=samuel@sholland.org \
    --cc=wens@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®