pinctrl: cs42l43: Fix leaked pm reference on error path

Returning directly if the regmap_update_bits() fails causes a pm runtime
reference to be leaked, let things run to the end of the function
instead.

Fixes: e52c741907 ("pinctrl: cirrus: cs42l43: use new GPIO line value setter callbacks")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
This commit is contained in:
Charles Keepax 2026-05-08 15:34:52 +01:00 committed by Linus Walleij
parent ce4e27247c
commit 1cb73b83ab

View File

@ -499,12 +499,10 @@ static int cs42l43_gpio_set(struct gpio_chip *chip, unsigned int offset,
ret = regmap_update_bits(priv->regmap, CS42L43_GPIO_CTRL1,
BIT(shift), value << shift);
if (ret)
return ret;
pm_runtime_put(priv->dev);
return 0;
return ret;
}
static int cs42l43_gpio_direction_out(struct gpio_chip *chip,