summaryrefslogtreecommitdiff
path: root/drivers/pinctrl/core.c
diff options
context:
space:
mode:
authorDong Aisheng <dong.aisheng@linaro.org>2012-05-23 21:22:40 +0800
committerLinus Walleij <linus.walleij@linaro.org>2012-07-03 21:51:07 +0200
commit5d589b092ab212bbcc27828167e1c036e7fc77d2 (patch)
treed3c9dcc8ae1f647d912179b4bfd98e27bbdb801a /drivers/pinctrl/core.c
parentda9aecb02d8763ef17130dfd7c678747ad84b070 (diff)
pinctrl: remove pinctrl_remove_gpio_range
The gpio ranges will be automatically removed when the pinctrl driver is unregistered. Acked-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/core.c')
-rw-r--r--drivers/pinctrl/core.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index 50d9c289cffd..902428dfb37e 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -333,20 +333,6 @@ void pinctrl_add_gpio_range(struct pinctrl_dev *pctldev,
EXPORT_SYMBOL_GPL(pinctrl_add_gpio_range);
/**
- * pinctrl_remove_gpio_range() - remove a range of GPIOs fro a pin controller
- * @pctldev: pin controller device to remove the range from
- * @range: the GPIO range to remove
- */
-void pinctrl_remove_gpio_range(struct pinctrl_dev *pctldev,
- struct pinctrl_gpio_range *range)
-{
- mutex_lock(&pinctrl_mutex);
- list_del(&range->node);
- mutex_unlock(&pinctrl_mutex);
-}
-EXPORT_SYMBOL_GPL(pinctrl_remove_gpio_range);
-
-/**
* pinctrl_get_group_selector() - returns the group selector for a group
* @pctldev: the pin controller handling the group
* @pin_group: the pin group to look up
@@ -1480,6 +1466,7 @@ EXPORT_SYMBOL_GPL(pinctrl_register);
*/
void pinctrl_unregister(struct pinctrl_dev *pctldev)
{
+ struct pinctrl_gpio_range *range, *n;
if (pctldev == NULL)
return;
@@ -1495,6 +1482,10 @@ void pinctrl_unregister(struct pinctrl_dev *pctldev)
/* Destroy descriptor tree */
pinctrl_free_pindescs(pctldev, pctldev->desc->pins,
pctldev->desc->npins);
+ /* remove gpio ranges map */
+ list_for_each_entry_safe(range, n, &pctldev->gpio_ranges, node)
+ list_del(&range->node);
+
kfree(pctldev);
mutex_unlock(&pinctrl_mutex);