pinctrl: nomadik: use utils map free function
authorLinus Walleij <linus.walleij@linaro.org>
Mon, 29 Sep 2014 13:22:20 +0000 (15:22 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 29 Sep 2014 13:22:20 +0000 (15:22 +0200)
Stop brewing our own map free function and rely on the pinctrl
utils helpers.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/nomadik/pinctrl-nomadik.c

index 9fe31daf9230d49b5e4a7b28e8148a3c1a373941..6c9667a44b7b633fc5afdcb172f86d8c7106537c 100644 (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);
 }
 
-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,
                unsigned *num_maps, const char *group,
                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,
                                &reserved_maps, num_maps);
                if (ret < 0) {
-                       nmk_pinctrl_dt_free_map(pctldev, *map, *num_maps);
+                       pinctrl_utils_dt_free_map(pctldev, *map, *num_maps);
                        return ret;
                }
        }
@@ -1595,7 +1584,7 @@ static const struct pinctrl_ops nmk_pinctrl_ops = {
        .get_group_pins = nmk_get_group_pins,
        .pin_dbg_show = nmk_pin_dbg_show,
        .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)