pinctrl: nomadik: use utils map free function

Stop brewing our own map free function and rely on the pinctrl
utils helpers.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
Linus Walleij 2014-09-29 15:22:20 +02:00
parent ba388294a5
commit 6e9b1c351d

View File

@ -1339,17 +1339,6 @@ static void nmk_pin_dbg_show(struct pinctrl_dev *pctldev, struct seq_file *s,
nmk_gpio_dbg_show_one(s, pctldev, chip, offset - chip->base, offset); nmk_gpio_dbg_show_one(s, pctldev, chip, offset - chip->base, offset);
} }
static void nmk_pinctrl_dt_free_map(struct pinctrl_dev *pctldev,
struct pinctrl_map *map, unsigned num_maps)
{
int i;
for (i = 0; i < num_maps; i++)
if (map[i].type == PIN_MAP_TYPE_CONFIGS_PIN)
kfree(map[i].data.configs.configs);
kfree(map);
}
static int nmk_dt_add_map_mux(struct pinctrl_map **map, unsigned *reserved_maps, static int nmk_dt_add_map_mux(struct pinctrl_map **map, unsigned *reserved_maps,
unsigned *num_maps, const char *group, unsigned *num_maps, const char *group,
const char *function) const char *function)
@ -1581,7 +1570,7 @@ static int nmk_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev,
ret = nmk_pinctrl_dt_subnode_to_map(pctldev, np, map, ret = nmk_pinctrl_dt_subnode_to_map(pctldev, np, map,
&reserved_maps, num_maps); &reserved_maps, num_maps);
if (ret < 0) { if (ret < 0) {
nmk_pinctrl_dt_free_map(pctldev, *map, *num_maps); pinctrl_utils_dt_free_map(pctldev, *map, *num_maps);
return ret; return ret;
} }
} }
@ -1595,7 +1584,7 @@ static const struct pinctrl_ops nmk_pinctrl_ops = {
.get_group_pins = nmk_get_group_pins, .get_group_pins = nmk_get_group_pins,
.pin_dbg_show = nmk_pin_dbg_show, .pin_dbg_show = nmk_pin_dbg_show,
.dt_node_to_map = nmk_pinctrl_dt_node_to_map, .dt_node_to_map = nmk_pinctrl_dt_node_to_map,
.dt_free_map = nmk_pinctrl_dt_free_map, .dt_free_map = pinctrl_utils_dt_free_map,
}; };
static int nmk_pmx_get_funcs_cnt(struct pinctrl_dev *pctldev) static int nmk_pmx_get_funcs_cnt(struct pinctrl_dev *pctldev)