Skip to contentSkip to conversation

gpio: pl061: Add pl061_gpio_free()

PATCH In review Axel Lin 2 participants 2 messages Mar 15, 2013 – Mar 27, 2013 GPIO

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 gpio: pl061: Add pl061_gpio_free()

commit 39b70ee051 "gpio: pl061: bind pinctrl by gpio request" adds pl061_gpio_request() to request pinctrl.
Thus we need to add corresponding pl061_gpio_free() to free the pin.

---
 drivers/gpio/gpio-pl061.c |    8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpio/gpio-pl061.c +8 -0
index 06ed257..d7008df 100644
@@ -72,6 +72,13 @@ static int pl061_gpio_request(struct gpio_chip *chip, unsigned offset)
 	return pinctrl_request_gpio(gpio);
 }
 
+static void pl061_gpio_free(struct gpio_chip *chip, unsigned offset)
+{
+	int gpio = chip->base + offset;
+
+	pinctrl_free_gpio(gpio);
+}
+
 static int pl061_direction_input(struct gpio_chip *gc, unsigned offset)
 {
 	struct pl061_gpio *chip = container_of(gc, struct pl061_gpio, gc);
@@ -287,6 +294,7 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id)
 	spin_lock_init(&chip->lock);
 
 	chip->gc.request = pl061_gpio_request;
+	chip->gc.free = pl061_gpio_free;
 	chip->gc.direction_input = pl061_direction_input;
 	chip->gc.direction_output = pl061_direction_output;
 	chip->gc.get = pl061_get_value;
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 5 lines · Axel Lin

commit 39b70ee051 "gpio: pl061: bind pinctrl by gpio request" adds pl061_gpio_request() to request pinctrl.
Thus we need to add corresponding pl061_gpio_free() to free the pin.

Excellent catch Axel (as usual).

Correct Haojian?

Patch applied.

Yours,
Linus Walleij