mirror of
https://github.com/torvalds/linux.git
synced 2024-11-28 23:21:31 +00:00
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>
This commit is contained in:
parent
da9aecb02d
commit
5d589b092a
@ -332,20 +332,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
|
||||
@ -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);
|
||||
|
@ -764,7 +764,6 @@ int __devexit tegra_pinctrl_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct tegra_pmx *pmx = platform_get_drvdata(pdev);
|
||||
|
||||
pinctrl_remove_gpio_range(pmx->pctl, &tegra_pinctrl_gpio_range);
|
||||
pinctrl_unregister(pmx->pctl);
|
||||
|
||||
return 0;
|
||||
|
@ -1175,8 +1175,6 @@ static int __devexit u300_pmx_remove(struct platform_device *pdev)
|
||||
struct u300_pmx *upmx = platform_get_drvdata(pdev);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(u300_gpio_ranges); i++)
|
||||
pinctrl_remove_gpio_range(upmx->pctl, &u300_gpio_ranges[i]);
|
||||
pinctrl_unregister(upmx->pctl);
|
||||
iounmap(upmx->virtbase);
|
||||
release_mem_region(upmx->phybase, upmx->physize);
|
||||
|
@ -131,8 +131,6 @@ extern void pinctrl_unregister(struct pinctrl_dev *pctldev);
|
||||
extern bool pin_is_valid(struct pinctrl_dev *pctldev, int pin);
|
||||
extern void pinctrl_add_gpio_range(struct pinctrl_dev *pctldev,
|
||||
struct pinctrl_gpio_range *range);
|
||||
extern void pinctrl_remove_gpio_range(struct pinctrl_dev *pctldev,
|
||||
struct pinctrl_gpio_range *range);
|
||||
extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev);
|
||||
extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev);
|
||||
#else
|
||||
|
Loading…
Reference in New Issue
Block a user