Unverified Commit 894077d5 authored by Linus Walleij's avatar Linus Walleij Committed by Mark Brown
Browse files

regulator: max8952: Let core handle GPIO descriptor



Use the gpiod_get() rather than the devm_* version so that the
regulator core can handle the lifecycle of these descriptors.

Fixes: d7a261c2 ("regulator: max8952: Pass descriptor instead of GPIO number")
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Reviewed-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Tested-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 2bb8ede0
Loading
Loading
Loading
Loading
+7 −3
Original line number Original line Diff line number Diff line
@@ -231,7 +231,11 @@ static int max8952_pmic_probe(struct i2c_client *client,
	else
	else
		gflags = GPIOD_OUT_LOW;
		gflags = GPIOD_OUT_LOW;
	gflags |= GPIOD_FLAGS_BIT_NONEXCLUSIVE;
	gflags |= GPIOD_FLAGS_BIT_NONEXCLUSIVE;
	gpiod = devm_gpiod_get_optional(&client->dev,
	/*
	 * Do not use devm* here: the regulator core takes over the
	 * lifecycle management of the GPIO descriptor.
	 */
	gpiod = gpiod_get_optional(&client->dev,
				   "max8952,en",
				   "max8952,en",
				   gflags);
				   gflags);
	if (IS_ERR(gpiod))
	if (IS_ERR(gpiod))