[PATCH] gpio-uclass: fix gpio flags save condition

Kory Maincent kory.maincent at bootlin.com
Fri Jan 22 16:23:49 CET 2021


The commit cd2faeba1a moves the location where we save the flags to the gpio
descriptor but it adds a "!" character.
This breaks the condition we expect to save the flags.

Signed-off-by: Kory Maincent <kory.maincent at bootlin.com>
---
 drivers/gpio/gpio-uclass.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-uclass.c b/drivers/gpio/gpio-uclass.c
index 0c01413b58..39db89c004 100644
--- a/drivers/gpio/gpio-uclass.c
+++ b/drivers/gpio/gpio-uclass.c
@@ -650,7 +650,7 @@ static int _dm_gpio_set_dir_flags(struct gpio_desc *desc, ulong flags)
 	}
 
 	/* save the flags also in descriptor */
-	if (!ret)
+	if (ret)
 		desc->flags = flags;
 
 	return ret;
-- 
2.17.1



More information about the U-Boot mailing list