]> git.baikalelectronics.ru Git - kernel.git/commit
regulator: max77686: Let core handle GPIO descriptor
authorLinus Walleij <linus.walleij@linaro.org>
Thu, 6 Dec 2018 12:43:43 +0000 (13:43 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 11 Dec 2018 01:04:08 +0000 (01:04 +0000)
commit8b347a632a75680c5585a4eebd36590c17e13616
tree62ff650c161160ca4a524af4910b9aab5f1b98ab
parent2a6b1913b99b0b894bbb390dea146ed2ad82020d
regulator: max77686: Let core handle GPIO descriptor

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

Fix up the errorpath so that we free this descriptor if
an error occurs in the callback. Rely on the regulator
core to deal with it after this point: a previous patch
fixed up the regulator core to properly dispose any
GPIO descriptors once you call regulator_register().

Fixes: c70f3c9bb9a8 ("regulator: max77686: Pass descriptor instead of GPIO number")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/max77686-regulator.c