.endianness             = 1,
 };
 
-static void chip_gpio_set(struct gpio_chip *c, unsigned int offset, int val)
+static int chip_gpio_set(struct gpio_chip *c, unsigned int offset, int val)
 {
        struct regmap *regmap = gpiochip_get_data(c);
        unsigned int mask = BIT(offset);
 
-       regmap_update_bits(regmap, REG_GPIO_DAT, mask, val ? mask : 0);
+       return regmap_update_bits(regmap, REG_GPIO_DAT, mask, val ? mask : 0);
 }
 
 static int chip_gpio_get(struct gpio_chip *c, unsigned int offset)
 {
        struct regmap *regmap = gpiochip_get_data(c);
        unsigned int mask = BIT(offset);
+       int ret;
+
+       ret = chip_gpio_set(c, offset, val);
+       if (ret)
+               return ret;
 
-       chip_gpio_set(c, offset, val);
        return regmap_update_bits(regmap, REG_GPIO_DIR, mask, mask);
 }
 
        .direction_input = chip_direction_input,
        .direction_output = chip_direction_output,
        .get = chip_gpio_get,
-       .set = chip_gpio_set,
+       .set_rv = chip_gpio_set,
 
        .can_sleep = true,
 };