gpio: wcd934x: check the return value of regmap_update_bits()

[ Upstream commit ff0f0d7c6587e38c308be9905e36f86e98fb9c1f ]

regmap_update_bits() can fail so check its return value in
wcd_gpio_direction_output() for consistency with the rest of the code
and propagate any errors.

Link: https://lore.kernel.org/r/20250709-gpiochip-set-rv-gpio-remaining-v1-2-b8950f69618d@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Bartosz Golaszewski
2025-07-09 08:41:39 +02:00
committed by Greg Kroah-Hartman
parent 1e281d3796
commit f8c816e361

View File

@@ -45,9 +45,12 @@ static int wcd_gpio_direction_output(struct gpio_chip *chip, unsigned int pin,
int val)
{
struct wcd_gpio_data *data = gpiochip_get_data(chip);
int ret;
regmap_update_bits(data->map, WCD_REG_DIR_CTL_OFFSET,
WCD_PIN_MASK(pin), WCD_PIN_MASK(pin));
ret = regmap_update_bits(data->map, WCD_REG_DIR_CTL_OFFSET,
WCD_PIN_MASK(pin), WCD_PIN_MASK(pin));
if (ret)
return ret;
return regmap_update_bits(data->map, WCD_REG_VAL_CTL_OFFSET,
WCD_PIN_MASK(pin),