[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMRc=Mc39GNBXFX6DOAr3mgk=FdPTUZBaxr=6jUA+zBbNizt9A@mail.gmail.com>
Date: Wed, 7 Jan 2026 09:52:42 +0100
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Dan Carpenter <dan.carpenter@...aro.org>
Cc: Jonas Jelonek <jelonek.jonas@...il.com>, Linus Walleij <linus.walleij@...aro.org>,
Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>,
Peter Rosin <peda@...ntia.se>, Geert Uytterhoeven <geert+renesas@...der.be>, linux-gpio@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
Thomas Richard <thomas.richard@...tlin.com>
Subject: Re: [PATCH v7 2/2] gpio: add gpio-line-mux driver
On Wed, Jan 7, 2026 at 9:40 AM Dan Carpenter <dan.carpenter@...aro.org> wrote:
>
> On Sat, Dec 27, 2025 at 06:01:34PM +0000, Jonas Jelonek wrote:
> > +struct gpio_lmux {
> > + struct gpio_chip gc;
> > + struct mux_control *mux;
> > + struct gpio_desc *muxed_gpio;
> > +
> > + u32 num_gpio_mux_states;
> > + unsigned int gpio_mux_states[] __counted_by(num_gpio_mux_states);
> > +};
> > +
> > +static int gpio_lmux_gpio_get(struct gpio_chip *gc, unsigned int offset)
> > +{
> > + struct gpio_lmux *glm = gpiochip_get_data(gc);
> > + int ret;
> > +
> > + if (offset > gc->ngpio)
>
> This is off by one. Should be >=.
>
And it's not even needed, GPIO core handles it. I'll send a patch to remove it.
Bart
Powered by blists - more mailing lists