From: Heiko Schocher Date: Fri, 22 May 2020 09:08:56 +0000 (+0200) Subject: gpio-uclass.c: save the GPIOD flags also in the gpio descriptor X-Git-Tag: v2025.01-rc5-pxa1908~2335^2~1 X-Git-Url: http://git.dujemihanovic.xyz/img/%7B%7B%20%24image.RelPermalink%20%7D%7D?a=commitdiff_plain;h=cd2faeba1abc08e5adba736e75dc665742cc310c;p=u-boot.git gpio-uclass.c: save the GPIOD flags also in the gpio descriptor save the GPIOD_ flags also in the gpio descriptor. Signed-off-by: Heiko Schocher Reviewed-by: Patrick Delaunay Fixes: 788ea834124b ("gpio: add function _dm_gpio_set_dir_flags") Reviewed-by: Simon Glass Tested-by: Walter Lozano --- diff --git a/drivers/gpio/gpio-uclass.c b/drivers/gpio/gpio-uclass.c index 9eeab22eef..f016532354 100644 --- a/drivers/gpio/gpio-uclass.c +++ b/drivers/gpio/gpio-uclass.c @@ -600,6 +600,10 @@ static int _dm_gpio_set_dir_flags(struct gpio_desc *desc, ulong flags) } } + /* save the flags also in descriptor */ + if (!ret) + desc->flags = flags; + return ret; } @@ -615,10 +619,6 @@ int dm_gpio_set_dir_flags(struct gpio_desc *desc, ulong flags) flags |= desc->flags; ret = _dm_gpio_set_dir_flags(desc, flags); - /* update the descriptor flags */ - if (ret) - desc->flags = flags; - return ret; }