public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] regulator: core: Still free GPIOs using gpio_free()
@ 2014-07-01 11:55 Mark Brown
  2014-07-01 12:06 ` Russell King - ARM Linux
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Brown @ 2014-07-01 11:55 UTC (permalink / raw)
  To: linux-arm-kernel

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] 7+ messages in thread

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

Thread overview: 7+ 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 12:06 ` Russell King - ARM Linux
2014-07-01 12:11   ` Mark Brown
2014-07-01 12:24     ` Alexandre Courbot
2014-07-01 12:27       ` Mark Brown
2014-07-08  8:33         ` Linus Walleij
2014-07-08 11:53           ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox