summaryrefslogtreecommitdiff
path: root/drivers/regulator/lp8788-ldo.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2018-12-06 15:43:40 +0300
committerMark Brown <broonie@kernel.org>2018-12-11 04:03:54 +0300
commit2bb8ede0b14187c19b5eedc62cf0b18b3bf00d3b (patch)
tree4befa265bd594a507aa1d89f71a7b171f5244f89 /drivers/regulator/lp8788-ldo.c
parente8a33aa0e3bc22134bf2bf3ca6339d6a1b7ffe16 (diff)
downloadlinux-2bb8ede0b14187c19b5eedc62cf0b18b3bf00d3b.tar.xz
regulator: lp8788-ldo: 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: 2468f0d51548 ("regulator: lp8788-ldo: Pass descriptor instead of GPIO number") Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/lp8788-ldo.c')
-rw-r--r--drivers/regulator/lp8788-ldo.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/regulator/lp8788-ldo.c b/drivers/regulator/lp8788-ldo.c
index 553b4790050f..2ee22e7ea675 100644
--- a/drivers/regulator/lp8788-ldo.c
+++ b/drivers/regulator/lp8788-ldo.c
@@ -501,8 +501,12 @@ static int lp8788_config_ldo_enable_mode(struct platform_device *pdev,
return 0;
}
- /* FIXME: check default mode for GPIO here: high or low? */
- ldo->ena_gpiod = devm_gpiod_get_index_optional(&pdev->dev,
+ /*
+ * Do not use devm* here: the regulator core takes over the
+ * lifecycle management of the GPIO descriptor.
+ * FIXME: check default mode for GPIO here: high or low?
+ */
+ ldo->ena_gpiod = gpiod_get_index_optional(&pdev->dev,
"enable",
enable_id,
GPIOD_OUT_HIGH |