Re: [PATCH v4 1/2] gpio: tegra186: Use generic macro for port definitions

From: Thierry Reding
Date: Fri Oct 10 2025 - 09:03:18 EST


On Fri, Oct 10, 2025 at 03:43:30PM +0530, Kartik Rajput wrote:
> Introduce a generic macro TEGRA_GPIO_PORT to define SoC specific
> ports macros. This simplifies the code and avoids unnecessary
> duplication.
>
> Suggested-by: Jon Hunter <jonathanh@xxxxxxxxxx>
> Signed-off-by: Kartik Rajput <kkartik@xxxxxxxxxx>
> Reviewed-by: Jon Hunter <jonathanh@xxxxxxxxxx>
> ---
> drivers/gpio/gpio-tegra186.c | 87 +++++++++++-------------------------
> 1 file changed, 25 insertions(+), 62 deletions(-)
>
> diff --git a/drivers/gpio/gpio-tegra186.c b/drivers/gpio/gpio-tegra186.c
> index 4d3db6e06eeb..7ea541d6d537 100644
> --- a/drivers/gpio/gpio-tegra186.c
> +++ b/drivers/gpio/gpio-tegra186.c
> @@ -1002,14 +1002,17 @@ static int tegra186_gpio_probe(struct platform_device *pdev)
> return devm_gpiochip_add_data(&pdev->dev, &gpio->gpio, gpio);
> }
>
> -#define TEGRA186_MAIN_GPIO_PORT(_name, _bank, _port, _pins) \
> - [TEGRA186_MAIN_GPIO_PORT_##_name] = { \
> - .name = #_name, \
> - .bank = _bank, \
> - .port = _port, \
> - .pins = _pins, \
> +#define TEGRA_GPIO_PORT(_prefix, _name, _bank, _port, _pins) \
> + [_prefix##_GPIO_PORT_##_name] = { \
> + .name = #_name, \
> + .bank = _bank, \
> + .port = _port, \
> + .pins = _pins, \

If you keep the whitespace you can save another 8 lines of diff since
these last four lines are exactly the same.

Not a big deal, so either way:

Acked-by: Thierry Reding <treding@xxxxxxxxxx>

Attachment: signature.asc
Description: PGP signature