[RFT PATCH v2 01/14] gpio: regmap: use the correct number for .ngpio_per_reg
Andy Shevchenko
andriy.shevchenko at linux.intel.com
Fri Nov 27 09:19:36 PST 2026
On Fri, Nov 27, 2026 at 03:52:18PM +0100, Michael Walle wrote:
> Setting .ngpio_per_reg to 0 means that gpio-regmap assumes there is only
> one register. If the number of GPIOs comes from gpiochip_get_ngpios()
> config->ngpio is still 0 and it's taking over the wrong number.
>
> Fix it by using chip->ngpio, which uses either config->ngpio or
> gpiochip_get_ngpios().
...
> Fixes: db305161880a ("gpio: regmap: Allow ngpio to be read from the property")
Not sure, before that commit the assumed configuration never worked.
But not objecting it, up to Bart.
...
> /* if not set, assume there is only one register */
^^^ Seems like the comment lacks of an adjustment.
> gpio->ngpio_per_reg = config->ngpio_per_reg;
> if (!gpio->ngpio_per_reg)
> - gpio->ngpio_per_reg = config->ngpio;
> + gpio->ngpio_per_reg = chip->ngpio;
--
With Best Regards,
Andy Shevchenko
More information about the linux-arm-kernel
mailing list