summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorHeiko Schocher <[email protected]>2020-05-22 11:08:56 +0200
committerTom Rini <[email protected]>2020-07-05 08:06:09 -0400
commitcd2faeba1abc08e5adba736e75dc665742cc310c (patch)
treefdde680fc0bdbf6b7f124e4dad34d568b9b81b94 /drivers
parent06e1321553ffa442248e35d9100fd70153690348 (diff)
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 <[email protected]> Reviewed-by: Patrick Delaunay <[email protected]> Fixes: 788ea834124b ("gpio: add function _dm_gpio_set_dir_flags") Reviewed-by: Simon Glass <[email protected]> Tested-by: Walter Lozano <[email protected]>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpio/gpio-uclass.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpio/gpio-uclass.c b/drivers/gpio/gpio-uclass.c
index 9eeab22eef5..f016532354f 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;
}