linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael Walle" <mwalle@kernel.org>
To: "Ioana Ciornei" <ioana.ciornei@nxp.com>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Bartosz Golaszewski" <brgl@bgdev.pl>,
	"Shawn Guo" <shawnguo@kernel.org>, "Lee Jones" <lee@kernel.org>,
	<devicetree@vger.kernel.org>, <linux-gpio@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Cc: "Frank Li" <Frank.Li@nxp.com>
Subject: Re: [PATCH v4 06/11] gpio: regmap: add the .fixed_direction_output configuration parameter
Date: Fri, 19 Sep 2025 15:41:00 +0200	[thread overview]
Message-ID: <DCWTIV3281OX.1N3AA8K3T21LY@kernel.org> (raw)
In-Reply-To: <20250919132515.1895640-7-ioana.ciornei@nxp.com>

[-- Attachment #1: Type: text/plain, Size: 1765 bytes --]

Hi,

> @@ -129,6 +130,13 @@ static int gpio_regmap_get_direction(struct gpio_chip *chip,
>  	unsigned int base, val, reg, mask;
>  	int invert, ret;
>  
> +	if (gpio->fixed_direction_output) {
> +		if (test_bit(offset, gpio->fixed_direction_output))
> +			return GPIO_LINE_DIRECTION_OUT;
> +		else
> +			return GPIO_LINE_DIRECTION_IN;
> +	}
> +
>  	if (gpio->reg_dat_base && !gpio->reg_set_base)
>  		return GPIO_LINE_DIRECTION_IN;
>  	if (gpio->reg_set_base && !gpio->reg_dat_base)
> @@ -277,6 +285,17 @@ struct gpio_regmap *gpio_regmap_register(const struct gpio_regmap_config *config
>  			return ERR_PTR(ret);

Not related to your patch, but this line above is wrong. That should
be "goto err_free_gpio". Would you mind adding a patch for it? I
could do it myself, but it will probably conflict with this series.
I'm fine either way (if you do it, don't forget the Fixes: tag).

>  	}
>  
> +	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.

Otherwise looks good.

-michael

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 297 bytes --]

  reply	other threads:[~2025-09-19 13:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-19 13:25 [PATCH v4 00/11] drivers: gpio: and the QIXIS FPGA GPIO controller Ioana Ciornei
2025-09-19 13:25 ` [PATCH v4 01/11] dt-bindings: gpio: add QIXIS FPGA based " Ioana Ciornei
2025-09-19 13:25 ` [PATCH v4 02/11] dt-bindings: fsl,fpga-qixis-i2c: add support for LX2160ARDB FPGA Ioana Ciornei
2025-09-19 13:25 ` [PATCH v4 03/11] dt-bindings: fsl,fpga-qixis: describe the gpio child node found on LS1046AQDS Ioana Ciornei
2025-09-22 19:50   ` Rob Herring (Arm)
2025-09-19 13:25 ` [PATCH v4 04/11] mfd: simple-mfd-i2c: keep compatible strings in alphabetical order Ioana Ciornei
2025-09-19 13:25 ` [PATCH v4 05/11] mfd: simple-mfd-i2c: add compatible string for LX2160ARDB Ioana Ciornei
2025-09-19 13:25 ` [PATCH v4 06/11] gpio: regmap: add the .fixed_direction_output configuration parameter Ioana Ciornei
2025-09-19 13:41   ` Michael Walle [this message]
2025-09-19 13:59     ` Ioana Ciornei
2025-09-19 14:07       ` Michael Walle
2025-09-19 14:12         ` Ioana Ciornei
2025-09-19 13:25 ` [PATCH v4 07/11] gpio: add QIXIS FPGA GPIO controller Ioana Ciornei
2025-09-19 13:25 ` [PATCH v4 08/11] arm64: dts: lx2160a-rdb: describe the QIXIS FPGA and two child GPIO controllers Ioana Ciornei
2025-09-19 13:25 ` [PATCH v4 09/11] arm64: dts: ls1046a-qds: describe the FPGA based GPIO controller Ioana Ciornei
2025-09-19 13:25 ` [PATCH v4 10/11] arm64: dts: lx2160a-rdb: fully describe the two SFP+ cages Ioana Ciornei
2025-09-19 13:25 ` [PATCH v4 11/11] arm64: dts: ls1046a-qds: describe the two on-board " Ioana Ciornei

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=DCWTIV3281OX.1N3AA8K3T21LY@kernel.org \
    --to=mwalle@kernel.org \
    --cc=Frank.Li@nxp.com \
    --cc=brgl@bgdev.pl \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=ioana.ciornei@nxp.com \
    --cc=krzk+dt@kernel.org \
    --cc=lee@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=shawnguo@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;
as well as URLs for NNTP newsgroup(s).