Re: [PATCH 07/10] gpio: regmap: Use resolved chip->ngpio for default ngpio_per_reg

From: Andy Shevchenko

Date: Fri Dec 04 2026 - 06:36:43 EST


On Thu, Dec 03, 2026 at 08:55:05PM +0000, Lee Jones wrote:
> When a caller leaves config->ngpio as 0 so gpiochip_get_ngpios() reads
> chip->ngpio from firmware and also leaves config->ngpio_per_reg as 0,
> gpio_regmap_register() falls back to setting gpio->ngpio_per_reg from
> config->ngpio (0) instead of chip->ngpio. Subsequent calls to
> gpio_regmap_simple_xlate() divide by zero.
>
> Use chip->ngpio as the default value for gpio->ngpio_per_reg.

I believe Michael already addressed this in his series.

--
With Best Regards,
Andy Shevchenko