diff options
-rw-r--r-- | drivers/gpio/gpio-uclass.c | 8 |
1 files changed, 4 insertions, 4 deletions
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; } |