From: Pali Rohár Date: Mon, 25 Jul 2022 11:56:13 +0000 (+0200) Subject: gpio: mvebu_gpio: Read number of gpios from DT X-Git-Tag: v2025.01-rc5-pxa1908~1329^2~20 X-Git-Url: http://git.dujemihanovic.xyz/%22/img/sics.gif/%22/static/git-favicon.png?a=commitdiff_plain;h=dc986c600ff738f35f6c29f8901bc40250d36734;p=u-boot.git gpio: mvebu_gpio: Read number of gpios from DT Device tree property "ngpios" contains number of gpios. Use it when available. Signed-off-by: Pali Rohár Reviewed-by: Stefan Roese --- diff --git a/drivers/gpio/mvebu_gpio.c b/drivers/gpio/mvebu_gpio.c index 888ccfe4d1..55ed685f70 100644 --- a/drivers/gpio/mvebu_gpio.c +++ b/drivers/gpio/mvebu_gpio.c @@ -92,7 +92,7 @@ static int mvebu_gpio_probe(struct udevice *dev) struct mvebu_gpio_priv *priv = dev_get_priv(dev); priv->regs = dev_read_addr_ptr(dev); - uc_priv->gpio_count = MVEBU_GPIOS_PER_BANK; + uc_priv->gpio_count = dev_read_u32_default(dev, "ngpios", MVEBU_GPIOS_PER_BANK); priv->name[0] = 'A' + dev_seq(dev); uc_priv->bank_name = priv->name;