Commit 2560c681 authored by Michael Walle's avatar Michael Walle Committed by Linus Walleij

pinctrl: microchip-sgpio: return error in spgio_output_set()

Make sgpio_output_set() return an error value. Don't just ignore the
return value of any regmap access but propagate it to our callers. Even
if the accesses never fail, this is a preparation patch to add single
shot mode where we need to poll a bit and thus we might get -ETIMEDOUT.
Signed-off-by: default avatarMichael Walle <michael@walle.cc>
Link: https://lore.kernel.org/r/20220226204507.2511633-5-michael@walle.ccSigned-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 0e68328e
...@@ -224,7 +224,7 @@ static inline void sgpio_configure_clock(struct sgpio_priv *priv, u32 clkfrq) ...@@ -224,7 +224,7 @@ static inline void sgpio_configure_clock(struct sgpio_priv *priv, u32 clkfrq)
sgpio_clrsetbits(priv, REG_SIO_CLOCK, 0, clr, set); sgpio_clrsetbits(priv, REG_SIO_CLOCK, 0, clr, set);
} }
static void sgpio_output_set(struct sgpio_priv *priv, static int sgpio_output_set(struct sgpio_priv *priv,
struct sgpio_port_addr *addr, struct sgpio_port_addr *addr,
int value) int value)
{ {
...@@ -245,10 +245,12 @@ static void sgpio_output_set(struct sgpio_priv *priv, ...@@ -245,10 +245,12 @@ static void sgpio_output_set(struct sgpio_priv *priv,
set = FIELD_PREP(SGPIO_SPARX5_BIT_SOURCE, value << bit); set = FIELD_PREP(SGPIO_SPARX5_BIT_SOURCE, value << bit);
break; break;
default: default:
return; return -EINVAL;
} }
sgpio_clrsetbits(priv, REG_PORT_CONFIG, addr->port, clr, set); sgpio_clrsetbits(priv, REG_PORT_CONFIG, addr->port, clr, set);
return 0;
} }
static int sgpio_output_get(struct sgpio_priv *priv, static int sgpio_output_get(struct sgpio_priv *priv,
...@@ -334,7 +336,7 @@ static int sgpio_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin, ...@@ -334,7 +336,7 @@ static int sgpio_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
case PIN_CONFIG_OUTPUT: case PIN_CONFIG_OUTPUT:
if (bank->is_input) if (bank->is_input)
return -EINVAL; return -EINVAL;
sgpio_output_set(priv, &addr, arg); err = sgpio_output_set(priv, &addr, arg);
break; break;
default: default:
...@@ -474,9 +476,7 @@ static int microchip_sgpio_direction_output(struct gpio_chip *gc, ...@@ -474,9 +476,7 @@ static int microchip_sgpio_direction_output(struct gpio_chip *gc,
sgpio_pin_to_addr(priv, gpio, &addr); sgpio_pin_to_addr(priv, gpio, &addr);
sgpio_output_set(priv, &addr, value); return sgpio_output_set(priv, &addr, value);
return 0;
} }
static int microchip_sgpio_get_direction(struct gpio_chip *gc, unsigned int gpio) static int microchip_sgpio_get_direction(struct gpio_chip *gc, unsigned int gpio)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment