]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
gpio-uclass.c: save the GPIOD flags also in the gpio descriptor
authorHeiko Schocher <hs@denx.de>
Fri, 22 May 2020 09:08:56 +0000 (11:08 +0200)
committerTom Rini <trini@konsulko.com>
Sun, 5 Jul 2020 12:06:09 +0000 (08:06 -0400)
save the GPIOD_ flags also in the gpio descriptor.

Signed-off-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
Fixes: 788ea834124b ("gpio: add function _dm_gpio_set_dir_flags")
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Walter Lozano <walter.lozano@collabora.com>
drivers/gpio/gpio-uclass.c

index 9eeab22eef5a63c72564083aa912dc944e7e1cab..f016532354f7831729fe43726a295fe3b47bed7b 100644 (file)
@@ -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;
 }