Re: [PATCH v4 06/11] gpio: regmap: add the .fixed_direction_output configuration parameter

From: Ioana Ciornei

Date: Fri Sep 19 2025 - 10:12:32 EST


On Fri, Sep 19, 2025 at 04:07:00PM +0200, Michael Walle wrote:

[snip]
> > > > }
> > > >
> > > > + if (config->fixed_direction_output) {
> > > > + gpio->fixed_direction_output = bitmap_alloc(chip->ngpio,
> > > > + GFP_KERNEL);
> > > > + if (!gpio->fixed_direction_output) {
> > > > + ret = -ENOMEM;
> > > > + goto err_free_gpio;
> > > > + }
> > > > + bitmap_copy(gpio->fixed_direction_output,
> > > > + config->fixed_direction_output, chip->ngpio);
> > > > + }
> > > > +
> > > > /* if not set, assume there is only one register */
> > > > gpio->ngpio_per_reg = config->ngpio_per_reg;
> > > > if (!gpio->ngpio_per_reg)
> > > > @@ -293,7 +312,7 @@ struct gpio_regmap *gpio_regmap_register(const struct gpio_regmap_config *config
> > > >
> > > > ret = gpiochip_add_data(chip, gpio);
> > > > if (ret < 0)
> > > > - goto err_free_gpio;
> > > > + goto err_free_bitmap;
> > >
> > > There's also an err_free_gpio jump below, that should also be
> > > replaced with err_free_bitmap.
> >
> > I am a bit confused. With this patch applied there is only one 'goto
> > err_free_gpio' in gpio-regmap.c and that's the one added by me above.
> >
> > What am I missing?
>
> Probably commit 553b75d4bfe9 ("gpio: regmap: Allow to allocate
> regmap-irq device") which was added to the mfd/gpio/next tree a
> couple of days ago.
>

Yes, I was on a 1-day old linux-next. Thanks for pointing this out.

In this case, I will have to do a v5 to also change that goto. I will
also add the patch that you requested.

Ioana