All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regulator: core: Still free GPIOs using gpio_free()
@ 2014-07-01 11:55 ` Mark Brown
  0 siblings, 0 replies; 14+ messages in thread
From: Mark Brown @ 2014-07-01 11:55 UTC (permalink / raw)
  To: Liam Girdwood, Linus Walleij, Russell King
  Cc: linux-arm-kernel, linux-kernel, linaro-kernel, Alexandre Courbot,
	Mark Brown

From: Mark Brown <broonie@linaro.org>

Even though we mostly use GPIO descriptors internally we still use
gpio_request_one() to request so we need to pair that with gpio_free() to
release the GPIO.

Reported-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
---
 drivers/regulator/core.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index c563d93125cd..80381409f856 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1710,7 +1710,12 @@ static void regulator_ena_gpio_free(struct regulator_dev *rdev)
 		if (pin->gpiod == rdev->ena_pin->gpiod) {
 			if (pin->request_count <= 1) {
 				pin->request_count = 0;
-				gpiod_put(pin->gpiod);
+				/*
+				 * Since we requested with gpio_request_one()
+				 * we still need to free with gpio_free()
+				 * for now.
+				 */
+				gpio_free(desc_to_gpio(pin->gpiod));
 				list_del(&pin->list);
 				kfree(pin);
 			} else {
-- 
2.0.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2014-07-08 12:34 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-01 11:55 [PATCH] regulator: core: Still free GPIOs using gpio_free() Mark Brown
2014-07-01 11:55 ` Mark Brown
2014-07-01 12:06 ` Russell King - ARM Linux
2014-07-01 12:06   ` Russell King - ARM Linux
2014-07-01 12:11   ` Mark Brown
2014-07-01 12:11     ` Mark Brown
2014-07-01 12:24     ` Alexandre Courbot
2014-07-01 12:24       ` Alexandre Courbot
2014-07-01 12:27       ` Mark Brown
2014-07-01 12:27         ` Mark Brown
2014-07-08  8:33         ` Linus Walleij
2014-07-08  8:33           ` Linus Walleij
2014-07-08 11:53           ` Mark Brown
2014-07-08 11:53             ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.