diff options
author | Antoine Tenart <antoine.tenart@free-electrons.com> | 2014-09-10 11:15:51 +0200 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2014-09-23 17:01:47 +0200 |
commit | 6064b1474ef3cfa523916008b5176026bbc990d3 (patch) | |
tree | b8f2e5effb24e5c031c86584a3a4a70bae7693d8 /drivers/pinctrl/berlin/berlin.c | |
parent | 3d78427397daea47b5a38642f46f75ef993de571 (diff) | |
download | linux-stable-6064b1474ef3cfa523916008b5176026bbc990d3.tar.gz linux-stable-6064b1474ef3cfa523916008b5176026bbc990d3.tar.bz2 linux-stable-6064b1474ef3cfa523916008b5176026bbc990d3.zip |
pinctrl: berlin: fix the dt_free_map function
The berlin_pinctrl_dt_free_map function tries to free memory
allocated and handled by the of subsystem. This is wrong and
already handled by pinctrl_dt_free_maps() which calls
of_node_put().
This patch fixes the Berlin pinctrl way of freeing its maps,
avoiding a kernel BUG(), by using the common
pinctrl_utils_dt_free_map function instead.
Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/berlin/berlin.c')
-rw-r--r-- | drivers/pinctrl/berlin/berlin.c | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/drivers/pinctrl/berlin/berlin.c b/drivers/pinctrl/berlin/berlin.c index 61f1bf0e60ba..7f0b0f93242b 100644 --- a/drivers/pinctrl/berlin/berlin.c +++ b/drivers/pinctrl/berlin/berlin.c @@ -99,30 +99,11 @@ static int berlin_pinctrl_dt_node_to_map(struct pinctrl_dev *pctrl_dev, return 0; } -static void berlin_pinctrl_dt_free_map(struct pinctrl_dev *pctrl_dev, - struct pinctrl_map *map, - unsigned nmaps) -{ - int i; - - for (i = 0; i < nmaps; i++) { - if (map[i].type == PIN_MAP_TYPE_MUX_GROUP) { - kfree(map[i].data.mux.group); - - /* a function can be applied to multiple groups */ - if (i == 0) - kfree(map[i].data.mux.function); - } - } - - kfree(map); -} - static const struct pinctrl_ops berlin_pinctrl_ops = { .get_groups_count = &berlin_pinctrl_get_group_count, .get_group_name = &berlin_pinctrl_get_group_name, .dt_node_to_map = &berlin_pinctrl_dt_node_to_map, - .dt_free_map = &berlin_pinctrl_dt_free_map, + .dt_free_map = &pinctrl_utils_dt_free_map, }; static int berlin_pinmux_get_functions_count(struct pinctrl_dev *pctrl_dev) |