diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2017-06-29 14:27:39 +0200 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2017-06-29 14:27:39 +0200 |
commit | 61830619675b97d3da34c59c71ae51646a205e2c (patch) | |
tree | e6d39f81284bdb86ba4214c89994fb454074f583 /drivers/pinctrl/core.c | |
parent | 8137f78a7fedeef1ffc0ac36e0ad68960eaf5010 (diff) | |
parent | c0bc126f97fb929b3ae02c1c62322645d70eb408 (diff) | |
download | linux-61830619675b97d3da34c59c71ae51646a205e2c.tar.bz2 |
Merge tag 'v4.12-rc7' into devel
Linux 4.12-rc7
Diffstat (limited to 'drivers/pinctrl/core.c')
-rw-r--r-- | drivers/pinctrl/core.c | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index 80d2314bc8a7..c5e2c5705058 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -680,30 +680,16 @@ EXPORT_SYMBOL_GPL(pinctrl_generic_remove_group); * pinctrl_generic_free_groups() - removes all pin groups * @pctldev: pin controller device * - * Note that the caller must take care of locking. + * Note that the caller must take care of locking. The pinctrl groups + * are allocated with devm_kzalloc() so no need to free them here. */ static void pinctrl_generic_free_groups(struct pinctrl_dev *pctldev) { struct radix_tree_iter iter; - struct group_desc *group; - unsigned long *indices; void **slot; - int i = 0; - - indices = devm_kzalloc(pctldev->dev, sizeof(*indices) * - pctldev->num_groups, GFP_KERNEL); - if (!indices) - return; radix_tree_for_each_slot(slot, &pctldev->pin_group_tree, &iter, 0) - indices[i++] = iter.index; - - for (i = 0; i < pctldev->num_groups; i++) { - group = radix_tree_lookup(&pctldev->pin_group_tree, - indices[i]); - radix_tree_delete(&pctldev->pin_group_tree, indices[i]); - devm_kfree(pctldev->dev, group); - } + radix_tree_delete(&pctldev->pin_group_tree, iter.index); pctldev->num_groups = 0; } |