]> git.sur5r.net Git - u-boot/blobdiff - drivers/gpio/mxs_gpio.c
dm: gpio: Add error handling and a function to claim vector GPIOs
[u-boot] / drivers / gpio / mxs_gpio.c
index d9a7a3aaf663e971b4b28b96801e4f402a6ced51..da0199b168ad68c8c69307e829c8fa715e3a86e4 100644 (file)
@@ -95,10 +95,10 @@ int gpio_direction_output(unsigned gpio, int value)
        struct mxs_register_32 *reg =
                (struct mxs_register_32 *)(MXS_PINCTRL_BASE + offset);
 
-       writel(1 << PAD_PIN(gpio), &reg->reg_set);
-
        gpio_set_value(gpio, value);
 
+       writel(1 << PAD_PIN(gpio), &reg->reg_set);
+
        return 0;
 }