Skip to contentSkip to conversation

gpio: mvebu: Set free callback for gpio_chip

PATCH In review Axel Lin 3 participants 3 messages Nov 8, 2012 GPIO

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 gpio: mvebu: Set free callback for gpio_chip

We call pinctrl_request_gpio() in request callback, thus we need to call pinctrl_free_gpio() in free callback.

Both mvebu_gpio_request() and mvebu_gpio_free() are not referenced outside of this file, make them static.

---
 drivers/gpio/gpio-mvebu.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpio/gpio-mvebu.c +3 -2
index 325c3de..a515b92 100644
@@ -168,12 +168,12 @@ static void __iomem *mvebu_gpioreg_level_mask(struct mvebu_gpio_chip *mvchip)
  * Functions implementing the gpio_chip methods
  */
 
-int mvebu_gpio_request(struct gpio_chip *chip, unsigned pin)
+static int mvebu_gpio_request(struct gpio_chip *chip, unsigned pin)
 {
 	return pinctrl_request_gpio(chip->base + pin);
 }
 
-void mvebu_gpio_free(struct gpio_chip *chip, unsigned pin)
+static void mvebu_gpio_free(struct gpio_chip *chip, unsigned pin)
 {
 	pinctrl_free_gpio(chip->base + pin);
 }
@@ -546,6 +546,7 @@ static int __devinit mvebu_gpio_probe(struct platform_device *pdev)
 	mvchip->chip.label = dev_name(&pdev->dev);
 	mvchip->chip.dev = &pdev->dev;
 	mvchip->chip.request = mvebu_gpio_request;
+	mvchip->chip.free = mvebu_gpio_free;
 	mvchip->chip.direction_input = mvebu_gpio_direction_input;
 	mvchip->chip.get = mvebu_gpio_get;
 	mvchip->chip.direction_output = mvebu_gpio_direction_output;
Signature · 1 line
1.7.9.5
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Axel Lin

We call pinctrl_request_gpio() in request callback, thus we need to call pinctrl_free_gpio() in free callback.

Both mvebu_gpio_request() and mvebu_gpio_free() are not referenced outside of this file, make them static.

Indeed, thanks.

Quoted 1 line
Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#2 lore raw
In reply to Axel Lin
Quoted 7 lines · Axel Lin

We call pinctrl_request_gpio() in request callback, thus we need to call pinctrl_free_gpio() in free callback.

Both mvebu_gpio_request() and mvebu_gpio_free() are not referenced outside of this file, make them static.

Applied with Thomas' ACK, thanks!

Yours,
Linus Walleij