summaryrefslogtreecommitdiff
path: root/drivers/pinctrl/pinctrl-stmfx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pinctrl/pinctrl-stmfx.c')
-rw-r--r--drivers/pinctrl/pinctrl-stmfx.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/pinctrl/pinctrl-stmfx.c b/drivers/pinctrl/pinctrl-stmfx.c
index aae01120dc52..c89b99003b71 100644
--- a/drivers/pinctrl/pinctrl-stmfx.c
+++ b/drivers/pinctrl/pinctrl-stmfx.c
@@ -115,14 +115,14 @@ static int stmfx_gpio_get(struct gpio_chip *gc, unsigned int offset)
return ret ? ret : !!(value & mask);
}
-static void stmfx_gpio_set(struct gpio_chip *gc, unsigned int offset, int value)
+static int stmfx_gpio_set(struct gpio_chip *gc, unsigned int offset, int value)
{
struct stmfx_pinctrl *pctl = gpiochip_get_data(gc);
u32 reg = value ? STMFX_REG_GPO_SET : STMFX_REG_GPO_CLR;
u32 mask = get_mask(offset);
- regmap_write_bits(pctl->stmfx->map, reg + get_reg(offset),
- mask, mask);
+ return regmap_write_bits(pctl->stmfx->map, reg + get_reg(offset),
+ mask, mask);
}
static int stmfx_gpio_get_direction(struct gpio_chip *gc, unsigned int offset)
@@ -161,8 +161,11 @@ static int stmfx_gpio_direction_output(struct gpio_chip *gc,
struct stmfx_pinctrl *pctl = gpiochip_get_data(gc);
u32 reg = STMFX_REG_GPIO_DIR + get_reg(offset);
u32 mask = get_mask(offset);
+ int ret;
- stmfx_gpio_set(gc, offset, value);
+ ret = stmfx_gpio_set(gc, offset, value);
+ if (ret)
+ return ret;
return regmap_write_bits(pctl->stmfx->map, reg, mask, mask);
}