[PATCH 6/8] gpio: mvebu_gpio: Read number of gpios from DT

Stefan Roese sr at denx.de
Thu Jul 28 08:28:46 CEST 2022


On 25.07.22 13:56, Pali Rohár wrote:
> Device tree property "ngpios" contains number of gpios.
> Use it when available.
> 
> Signed-off-by: Pali Rohár <pali at kernel.org>

Reviewed-by: Stefan Roese <sr at denx.de>

Thanks,
Stefan

> ---
>   drivers/gpio/mvebu_gpio.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpio/mvebu_gpio.c b/drivers/gpio/mvebu_gpio.c
> index 888ccfe4d13e..55ed685f70f8 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;
>   

Viele Grüße,
Stefan Roese

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de


More information about the U-Boot mailing list